in reply to Aliasing bites
On aliases, I wish Perl had more of 'em. This doesn't really have a lot to do with your meditation, but the topic made it spill out.
I'd like to have lexical variables which are aliases to other values. Currently, you only get that by defining a for loop variable:
I think that explicit aliasing which gives value semantics to references would be very desirable. A new alias keyword taking $_ as default argument would allow, for instance, named aliases for subroutine arguments:my ($foo,$bar,$baz,$i); for my $quux ($foo, $bar, $baz) { $quux = $i++; } print "$foo $bar $baz\n"; __END__ 0 1 2
where you wish to modify the external arguments.sub wibble { return unless @_ > 2; my ($string, $position, $count) = map { alias } @_; # . . . }
I expect this sort of thing has been discussed before.
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Aliasing bites
by iblech (Friar) on May 11, 2005 at 13:27 UTC | |
|
Re^2: Aliasing bites
by ambrus (Abbot) on May 11, 2005 at 14:20 UTC | |
by revdiablo (Prior) on May 11, 2005 at 16:28 UTC | |
|
Re^2: Aliasing bites
by BUU (Prior) on May 11, 2005 at 08:28 UTC | |
by revdiablo (Prior) on May 11, 2005 at 19:23 UTC |