in reply to A Romp Around addn
So, in Perl 6, by the time it gets into the first set of curlies { my ... }, $n is already a copy of the argument passed in to addn() and not simply an alias?sub addn($n) { my $retsub = sub ($x) { $x + $n } return $retsub; }
I'm curious. Thanks.sub addn($n) { my $m = $n; my $retsub = sub ($x) { $x + $m } return $retsub; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: A Romp Around addn
by John M. Dlugosz (Monsignor) on Aug 18, 2008 at 05:01 UTC |