1

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?

5
  • emacs.stackexchange.com/tags/elisp/info
    – Drew
    Commented Oct 2, 2020 at 18:50
  • Good afternoon. Explain why you provided this link? I am translating the manual into Russian, so such questions arise.
    – uanr81
    Commented Oct 4, 2020 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
    Commented Oct 4, 2020 at 4:11
  • And thanks for translating the Elisp manual! That's a great undertaking.
    – Drew
    Commented Oct 4, 2020 at 4:12
  • Thanks for the clarification
    – uanr81
    Commented Oct 4, 2020 at 6:03

1 Answer 1

3

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)))))
 12)

The lambda expression is the car of the whole form.

1
  • Thank you, it looks believable.
    – uanr81
    Commented Oct 2, 2020 at 13:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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