This question already has an answer here:
I'm reading about some concepts of Emacs Lisp. The lambda's seems interesting to me. After reading the manuals about lambda's in Emacs Lisp, I decided to play with it.
For example, I have this snippet:
(defun my-insert-arrow () (interactive) (insert "->")) (evil-define-key 'insert php-mode map (kbd "C-<next>") 'my-insert-arrow))
Okay, then I replace that function with a lambda:
(evil-define-key 'insert php-mode map (kbd "C-<next>") (lambda () (insert "->")))
But I got the following error:
command-execute: Wrong type argument: commandp, (lambda nil (insert "->"))
So it seems I applied the lambda in the wrong way. But I found no difference with the manuals, except that the lambda's in the tutorial examples contains arguments.