develooper Front page | perl.perl6.language | Postings from July 2001

Re: aliasing a value in a while each loop

Thread Previous | Thread Next
From:
John Porter
Date:
July 20, 2001 13:09
Subject:
Re: aliasing a value in a while each loop
Message ID:
20010720160925.A4774@min.net
David L. Nicol wrote:
>   Assignment to a nonexistent reference becomes an
>   alias instead of a copy.

Uh, I dunno.  Like Python/Ruby, but without the consistency.

I think special constructs -- defined as NOT doing assignment
-- should be allowed to set up aliases.  This includes, e.g. for().
Perhaps a simple

	alias( %foo, %bar );

for those times when you really just need a simple WTDI!

Multiple aliases in one swoop:

	alias
		%foo => %bar,
		@p => @Some::Other::Long::Class::Name::ISA,
		$x => $db{tbl}{col}[r],
		$y => substr( $s, 10, 15 ),
		@z => @a[5..8,13];

etc.

-- 
John Porter


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About