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

Re: [PATCH] Add a nextstate into empty blocks

Thread Previous | Thread Next
Ilmari Karonen
August 19, 2001 13:24
Re: [PATCH] Add a nextstate into empty blocks
Message ID:

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 " 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 --         (now works in v5.6 too!)

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About