Buddha Buck writes: : We have : while (foo()) -> $a {...} : doing the right thing.
Well, C<for> does that currently, not C<while>, but... : Why can't : : if foo() -> $a { ... } : : take the place of the perl5 : : if (my $a = foo()) {...} I'd do something explicit like ->$a before I'd do some implicit $? variable, which is gonna give the compiler fits trying to decide if it has to remember the value or not. On the other hand, we already have to do something like that for currying, so if you really want to do that, it's likely that this would have a similar meaning: if foo() { print $^a } In either case, the tricky thing is to pass the value returned by foo(), not the value returned by foo().true, or whatever the internal boolean method is. : Too bad we can't do : : while (foo() -> $a) && ($b < 4) { ... } : and have it do the right thing. Hey, C<my> still has to be useful for something... Larry