mirror of https://github.com/rusefi/bldc.git
11 lines
254 B
Common Lisp
11 lines
254 B
Common Lisp
|
(define map (lambda (f xs)
|
||
|
(let ((accmap (lambda (acc xs)
|
||
|
(if (= xs nil)
|
||
|
acc
|
||
|
(accmap (cons (f (car xs)) acc) (cdr xs))))))
|
||
|
(reverse (accmap nil xs)))))
|
||
|
|
||
|
(= (map (lambda (x) (+ x 1)) (list 1 2 3 4 5 6)) (list 2 3 4 5 6 7))
|
||
|
|
||
|
|