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

Re: assign to magic name-of-function variable instead of "return"

Thread Previous | Thread Next
From:
James Mastros
Date:
February 1, 2001 18:29
Subject:
Re: assign to magic name-of-function variable instead of "return"
Message ID:
20010201212906.A843@lilith.belledonna.mine.nu
On Thu, Feb 01, 2001 at 07:36:59PM -0600, David L. Nicol wrote:
> So a way
> to have the feature (direct assignment to external lvalue) and maintain
> portability might be to forget about magic names and just make the new
> LNV (which I am calling $__ in this thread) mean "An alias for the
> L-value of what the subroutine return value will get assigned to
A /much/ better syntax, IMHO.  However, $__ must act sanely when we're
called as an inner function (IE foo(bar(42))).

And I always hated that about VB and Pascal -- you can assign to the magic
variable, but can't modify it.  And if you try, you don't error, you
recruse.  And perl will happily recruse until you run out of memory, and VB
will give a stack overflow, and take down the IDE and your code unless
you're careful.

     -=- James Mastros
-- 
"My country 'tis of thee, of y'all i'm rappin'!  Lan where my brothers
fought, land where our King was shot -- from every building top, let freedom
happen!"
	-=- Monique, Sinfest[.net]
AIM: theorbtwo 	     homepage: http://www.rtweb.net/theorb/

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