esper,
See Re: What about if (my $var = foo()) { ... } for the Perl 6 construct.
Regarding an explanation as to why formal parameters to a block are cleaner, it is similar to subs with and without signatures. If that still doesn't make any sense, I will try again when I am well rested.
| [reply] |
Thanks for the pointer. I haven't been following Perl 6 at all, so some of the new syntax I'm seeing in Synopsis 4 is still a bit unclear, but I'm pretty sure I've at least got the formal parameters bit worked out. Personally, I think it looks less obvious/consistent than the existing Perl 5 equivalent (use my to create lexicals in some situations, use -> or ^ in others) for the small benefit of eliminating implicit scopes, but I can easily see how others would disagree, given the number of complaints I've seen about subs always starting with a bunch of mys and shifts.
| [reply] [d/l] [select] |