Menu

#4 defining new variables in a "forall" call

open
nobody
1
2006-03-19
2006-03-14
No

At the moment, if you want to do a forall loop, you must define the index
outside of the loop, like this:

#import <flx.flxh>

var i:int;
forall i in 0 upto 5 do
print i; endl;
done;

Any chance that that "i" could be implicitly made, like this?

#import <flx.flxh>

forall var i in 0 upto 5 do
print i; endl;
done;

I'd like it even better if that var was implicit too, if that were possible.

-e

Discussion

  • Erick Tryzelaar

    Erick Tryzelaar - 2006-03-19
    • priority: 5 --> 1
     
  • Erick Tryzelaar

    Erick Tryzelaar - 2006-03-19

    Logged In: YES
    user_id=41692

    Dropping priority.

    So this can be compressed into one line simply by doing this:

    var i:int; forall i in 0 upto 5 do
    print i; endl;
    done;

    Unfortunately, there's no work around to having to specify i as an int instead
    of it being inferred.

     

Log in to post a comment.