Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.python Subject: Re: Statements as expressions [was Re: Undefined behaviour in C] Date: Tue, 29 Mar 2016 01:54:24 -0700 Organization: A noiseless patient Spider Lines: 13 Message-ID: <87r3et4qbj.fsf@nightsong.com> References: <56f55e2e$0$1619$c3e8da3$5496439d@news.astraweb.com> <87wpoq1omm.fsf@elektro.pacujo.net> <56f5f81d$0$1585$c3e8da3$5496439d@news.astraweb.com> <87io0a6j1w.fsf@nightsong.com> <56f67ee3$0$1583$c3e8da3$5496439d@news.astraweb.com> <87poug5t0c.fsf@nightsong.com> <1344e2bf-15d2-412e-9512-b0aba800dada@googlegroups.com> <56f880ba$0$1617$c3e8da3$5496439d@news.astraweb.com> <87h9fr5qig.fsf@nightsong.com> <56fa3c2a$0$1591$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="ac130717aa033f117b1251f50cb4c61b"; logging-data="6176"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19smlzjsUAp2UzW2uqntHMZ" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:ubFOfRlXkfhrF87XNliaPyK7BCM= sha1:GxhtysdkT/+TwO5mDotZs0XCtgM= Xref: csiph.com comp.lang.python:105964 Steven D'Aprano 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 .