Live data from Hacker News

Stop writing lambda expressions in Python

treyhunner.com

201–202 of 202 posts

Re: Stop writing lambda expressions in Python

#201
post #174

Earlier quoted context omitted.

Haha, I had assumed someone would mention that. But most Lisps are pretty rough-and-ready about these sorts of things. IIRC, Scheme requires the body of the lambda to be a single expression, doesn't it? And then you just cheat your way out of it with (begin ...).

> IIRC, Scheme requires the body of the lambda to be a single expression, doesn't it? No, it doesn't require it.

It used to, though. From the original Scheme paper: Note that in SCHEME, unlike MacLISP, the body of a LAMBDA expression is not an implicit PROGN.

Re: Stop writing lambda expressions in Python

#202
post #201
post #174

Earlier quoted context omitted.

> IIRC, Scheme requires the body of the lambda to be a single expression, doesn't it? No, it doesn't require it.

It used to, though. From the original Scheme paper: Note that in SCHEME, unlike MacLISP, the body of a LAMBDA expression is not an implicit PROGN.

Changed in the early/mid 80s I think. AI Memo 848 (Revised Revised Report) from 1985 has it already as an 'essential special form': (lambda (var1 ...) expr1 expr2 ...)

R1RS does not permit it. And: In the the R1RS syntax BNF there is a (DEFINE ( ) ) with one form. But later in the document it is a ''... Then the LAMBDA syntax has a BODY, but it is only a FORM...

Post reply on HN