Jump to content

Apply a callback to an array: Difference between revisions

Line 124:
[[Category:Common Lisp]]
 
Imperative: print 1, 2, 3, 4 and 5.:
 
(map nil #'print #(1 2 3 4 5))
Line 133:
(map 'vector #'square #(1 2 3 4 5))
 
Destructive, like the JavaJavascript example; add 1 to every slot of vector *a*:
 
(defvar *a* (vector 1 2 3))
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.