let and flet in emacs lisp
问题 I don't know if you would call it the canonical formulation, but to bind a local function I am advised by the GNU manual to use 'flet': (defun adder-with-flet (x) (flet ( (f (x) (+ x 3)) ) (f x)) ) However, by accident I tried (after having played in Scheme for a bit) the following expression, where I bind a lambda expression to a variable using 'let', and it also works if I pass the function to mapcar*: (defun adder-with-let (x) (let ( (f (lambda (x) (+ x 3))) ) (car (mapcar* f (list x)) ))