Possible Duplicate:
How to pass a lambda expression in Elisp
I have following code:
(defun my-map (p l)
(mapcar (lambda (el) (p el)) l))
(defun test ()
(my-map (lambda (x) (+ x 1)) (list 1 2 3)))
(It's example - not actual code I tried to write). It complains that it cannot find function p:
Debugger entered--Lisp error: (void-function p)
(p el)
(lambda (el) (p el))(1)
mapcar((lambda (el) (p el)) (1 2 3))
my-map((lambda (x) (x + 1)) (1 2 3))
test()
eval((test) nil)
eval-expression((test) nil)
call-interactively(eval-expression nil nil)
recursive-edit()
debug(error (void-variable test))
eval(test nil)
eval-expression(test nil)
call-interactively(eval-expression nil nil
I guess that it treats a p
as symbol and not variable bounded in outer scope. How to make it work?