Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; See http://stackoverflow.com/a/27670789/1281433
- (defun %map-into (result-list function list &rest lists)
- "Like CL:MAP-INTO, but only accepts lists (as opposed
- to sequences)."
- (apply 'mapl
- (lambda (result-tail &rest args)
- (setf (first result-tail)
- (apply function (mapcar 'first args))))
- result-list
- list
- lists))
- (let ((a '(1 2 3 4))
- (b '(5 6 7 8)))
- (%map-into a '+ a b)
- a)
- ;=> (6 8 10 12)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement