Statements as expressions [was Re: Undefined behaviour in C]

Paul Rubin no.email at nospam.invalid
Tue Mar 29 04:54:24 EDT 2016


Steven D'Aprano <steve+comp.lang.python at pearwood.info> writes:
> The point is that there's nothing intrinsically obvious or right about 
> "return the value of the last statement in the block". 

Strictly speaking it returns the value of the block itself.  The block
is usually evaluated by PROG which returns the last value of the block,
but you could also use PROG1 which uses the first value, or PROG2 which
uses the second value.

> I've tried to get into Lisp a couple of times, and it doesn't speak to me. 
> If you want my opinion, Forth has a more natural evaluation model.

You might like Factor then, www.factorcode.org .



More information about the Python-list mailing list