What does this text mean, in node Simple Lambda Expression Example of the Emacs Lisp manual:

As these examples show, you can use a form with a lambda expression as its car to make local variables and give them values. In the old days of Lisp, this technique was the only way to bind and initialize local variables. But nowadays, it is clearer to use the special form let for this purpose

The use of let is clear to me, but what does car have to do with this?

  • Good afternoon. Explain why you provided this link? I am translating the manual into Russian, so such questions arise. – uanr81 Oct 4 '20 at 3:14
  • There's nothing wrong with the question. I removed tag elisp from it; that's all. That tag isn't for questions about using Elisp to do something. It's for questions about the nature of the language, in particular compared to other Lisp dialects. The linked explanation covers the purpose of the tag. – Drew Oct 4 '20 at 4:11
  • And thanks for translating the Elisp manual! That's a great undertaking. – Drew Oct 4 '20 at 4:12
  • Thanks for the clarification – uanr81 Oct 4 '20 at 6:03

The application of a lambda expression was used to populate the local variables in the expression, so for example what you can today write as

(let ((x 12))
  (message (number-to-string (- (* 4 x) (/ x 2)))))

you wrote as

((lambda (x)
   (message (number-to-string (- (* 4 x) (/ x 2)))))

The lambda expression is the car of the whole form.

  • Thank you, it looks believable. – uanr81 Oct 2 '20 at 13:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.