in reply to Using $_ as a temp var, especially in functions

From what I understand from a Perl 6 meeting a couple of weeks ago, it will have a "topic", which allows you to specify a value for the temporary value as its passed in... (ie

for @list -> $foo; # $foo can now be used in place of $_ for the rest +of the block

Also, $foo defaults to read-only, so you have to specificly specify read-write mode.

PS I'm sure I've made a mockery of Allison's speech, so please forgive me. Also, the minutes of our meeting should be up soon at Portland Perlmongers.

Topics and topicalizers are also explained in more detail in exegesis 4.
--
Ben
"Naked I came from my mother's womb, and naked I will depart."

Replies are listed 'Best First'.
Re^2: Using $_ as a temp var, especially in functions
by Aristotle (Chancellor) on Oct 26, 2002 at 02:29 UTC
    Which is what in Perl5 lingo is for my $foo (@list) { ... } except the read-only bit of course. ;-) Perl6 will offer additional abilities on top of this.

    Makeshifts last the longest.