-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlist.el
31 lines (23 loc) · 985 Bytes
/
list.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
;******************************************************************************;
; ;
; list.el for list ;
; Created on : Thu Oct 20 10:02:03 2011 ;
; Made by : David "Thor" GIRON <[email protected]> ;
; ;
;******************************************************************************;
(defun list-map (f l)
"Map function 'f' over list 'l' and returns the result list."
(mapcar f l
)
)
(defun list-iter (f l)
"Map procedure 'f' over list 'l' and returns nil."
(mapc f l)
nil
)
(defun list-fold (f s l)
"Returns f (... (f (f s e1) e2) ...) en."
(reduce f l :initial-value s)
)
;******************************************************************************;
(provide 'list)