On Fri, 9 Aug 2002, Adam Lopresto wrote:
: I was wondering whether the Perl 'while (<>){' idiom will continue to be
: supported in Perl 6?  I seem to recall people posting example code the list
: using it (although I can't dig any up), but it seems to me that if Perl 6's
: lazy list implementation is sufficiently smart, it could just be replaced with
: 'for <> {'.  The only issues I can see are people using <> inside the loop, and
: maybe something about the scope of $_.  (Does a topicalized $_ change the value
: of $_ outside of the loop?) 

Of the two constructs, I lean toward only making C<for> topicalize.
Possibly you can force an explicit topicalization on a C<while>
like this:

    while something() -> $_ { ... }

(Had an interesting typo there.  I put => insteaqd of ->.  I wonder
how much trouble that sort of thing is gonna cause.  Maybe pairs
can be disallowed or warned about where a pointy sub might be
expected.)

Larry

Reply via email to