develooper Front page | perl.perl5.porters | Postings from August 2001

Re: [PATCH] Add a nextstate into empty blocks

Thread Previous | Thread Next
From:
Ilmari Karonen
Date:
August 19, 2001 13:24
Subject:
Re: [PATCH] Add a nextstate into empty blocks
Message ID:
Pine.SOL.3.96.1010819230253.19768A-100000@simpukka

On Sun, 19 Aug 2001, Michael G Schwern wrote:

> On Sun, Aug 19, 2001 at 07:34:28PM +0200, Arthur Bergman wrote:
> > It is changing to definition from "Returns the value of the last
> > expression" to "Returns the value of the last expression in the
> > subroutine". Even if it seems more sane this way.
> 
> I've always assumed an implied "...in the subroutine" on the end of
> "last evaluated expression" anyway, and I'm probably not alone.

Besides, "returns the value of the last expression" describes the
current behavior only if you adopt a perversely convoluted definition of
"last expression", and even then only in list context.

What happens is that currently such a sub passes along whatever happens
to be lying on the stack.  This will usually be the argument list.  In
scalar context it will be ignored, but in list context it will be taken
to be the return value.  This is just plain broken.

-- 
# Ilmari Karonen -- http://www.sci.fi/~iltzu/         (now works in v5.6 too!)
s''n4|9|21|3|n1\2||2|(_-<2_|4_`1|3\3_1\2_|3\3-_)2_|n\__/\_,_|___/\__|2\__,_|_|
1_|\___/\__|_|1_|\___|_|nn4_1\9|3|14|n4__/1-_)2_|1|5\3_`1|2_|1!1/2-_)2_|n3_|1\
___|_|2_|2_|1_|\__,_|\__|_i_\\\___|_|1)n45/n',y/n\n/\n/d,s/\d+/$"x$&/eg,print;




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