Re: Should a closure-in-a-string get the placeholder parameters from its surroundings?

2008-11-21 Thread TSa
HaloO, Carl Mäsak wrote: I expected this to DWIM today: $ perl6 -e 'my $cl = { $^name upcased becomes {$^name.uc} }; say $cl(larry)' ...but it doesn't in Rakudo r32938: too few arguments passed (0) - 1 params expected ...and for understandable (if not good) reasons: the closure inside the

Re: Should a closure-in-a-string get the placeholder parameters from its surroundings?

2008-11-21 Thread Carl Mäsak
TSa (): I just want to make sure that I got the problem right. Would my $cl = { $^name upcased becomes {$^OUTER::name.uc} }; say $cl(larry) work? The idea is that the embedded closure refers to the strings $^name. And now the dwimmyness shall make that implicit, right? I guess that

Re: Should a closure-in-a-string get the placeholder parameters from its surroundings?

2008-11-21 Thread Larry Wall
On Fri, Nov 21, 2008 at 09:42:41AM +0100, TSa wrote: HaloO, Carl Mäsak wrote: I expected this to DWIM today: $ perl6 -e 'my $cl = { $^name upcased becomes {$^name.uc} }; say $cl(larry)' ...but it doesn't in Rakudo r32938: too few arguments passed (0) - 1 params expected ...and for