I mimic a general map function from SICP's
(define (map proc items)
(if (null? items)
nil
(cons (proc (car items))
(map proc (cdr items)))))
(map abs (list -10 2.5 -11.6 17))
Rephrase it with elisp
(defun map(proc items)
(if (null items)
nil
(cons (proc (car items))
(map proc (cdr items)))))
(map abs (list -10 2.5 -11.6 17))
Run but report error:
ELISP> (map abs (list -3 -5))
*** Eval error *** Symbol’s value as variable is void: abs
However, abs works
ELISP> (map abs (list -3 -5))
*** Eval error *** Symbol’s value as variable is void: abs
What's the problem with my rewriting?