Advertisement
Guest User

Untitled

a guest
Apr 8th, 2019
120
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (defun multiple-value-mapcar (fun list &rest other-lists)
  2. (values-list (apply (function mapcar) (function list)
  3. (loop
  4. :with all-lists := (cons list other-lists)
  5. :while (every (function identity) all-lists)
  6. :collect (multiple-value-list (apply fun (mapcar (function first) all-lists)))
  7. :do (setf all-lists (mapcar (function rest) all-lists))))))
  8.  
  9. (multiple-value-mapcar (function truncate) '(10 20 30) '(3 3 3))
  10. --> (3 6 10)
  11. (1 2 0)
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement