I want to write a small function to add a value to a list. it looks like this:
(defvar fares '(31.14 28.12 25.10 22.08 19.06 16.04 13.02 10))
(defun plus-extra (fare) (+ 3.02 fare))
(map 'plus-extra fares)
Fairly predictably, the elisp barfs because the function needs an argument. What am I missing?
Thanks
Robert
The function which doesn’t have enough argument here is
map, not the one you defined.The
mapfunction does not exists in Emacs Lisp, it is provided by theclpackage. Thismapfunction require 3 arguments, the first one must be the type of whatmapshould return. This:will work. But what you want is this:
which is native elisp.
PS: Don’t forget that Emacs comes with its documentation! C-h f map RET ;-).