Path: csiph.com!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Marko Rauhamaa Newsgroups: comp.lang.python Subject: Re: (test) ? a:b Date: Thu, 23 Oct 2014 19:20:03 +0300 Organization: A noiseless patient Spider Lines: 23 Message-ID: <87iojag3m4.fsf@elektro.pacujo.net> References: <54476af8$0$21651$426a74cc@news.free.fr> <7839376e-fc27-4299-ae63-4ddf17ef9a8a@googlegroups.com> <7d2ea3c1-504e-4f5c-8338-501b1483df38@googlegroups.com> <878uk6x5nd.fsf@elektro.pacujo.net> <87fvee3l35.fsf@dpt-info.u-strasbg.fr> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="ff5cf27ef3d5b31f034d3b72bdc27a41"; logging-data="8260"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+9ZDDD7GgQ8uN8WmPbNKIC" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:HpKv1V9kuLZ71Z540OKb5qeLRQQ= sha1:tOf5yhSaUcs9MecXFjd2ZxBoY+8= Xref: csiph.com comp.lang.python:79540 Alain Ketterlin : >> j = (lambda: 3, lambda: j + 1)[j < 10]() > > This is just a way to delay evaluation *of the potential results*, > i.e., instill a bit of lazyness. That's one way to characterize a function, or code in general. That point of view is apparent in PostScript, where control structures are expressed "lazily" with lambdas: 5 eq { gsave 0.85 1 0.85 setrgbcolor fill grestore } if The { ... } block is a piece of code pushed onto the stack. Marko