Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun multiple-value-mapcar (fun list &rest other-lists)
- (values-list (apply (function mapcar) (function list)
- (loop
- :with all-lists := (cons list other-lists)
- :while (every (function identity) all-lists)
- :collect (multiple-value-list (apply fun (mapcar (function first) all-lists)))
- :do (setf all-lists (mapcar (function rest) all-lists))))))
- (multiple-value-mapcar (function truncate) '(10 20 30) '(3 3 3))
- --> (3 6 10)
- (1 2 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement