All:
Please forgive me, but I have only recently started
following the language side of p6 after spending a
fair amount of time with Parrot.  Last night I
installed Pugs and wrote my first p6 code:

http://perlmonks.org/index.pl?node_id=451398

Reading S04, it seems that there are no implicit
blocks around control structures, so p5 code like:

while ( my @array = $ref->() ) { ... }

would scope my @array appropriately, it will not in p6

The solution is formal parameters.  The trouble is I
can't seem to find a good example in S04 that matches
what I am trying to do.

while $ref() -> @array { ... }

is what I think it might be modeling it after the for
loop, but the closest thing I see for while is:

while =$*IN -> $line {...}

I am happy to write tests to get the appropriate
functionality in Pugs, but I am not sure what is
appropriate???

Cheers,
Joshua Gatcomb
a.k.a. L~R



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to