| Paste number 22074: | splice, use what instead ? |
| Pasted by: | lhz |
| When: | 2 years, 11 months ago |
| Share: | Tweet this! | http://paste.lisp.org/+H16 |
| Channel: | #lisp |
| Paste contents: |
(defmacro splice (args fun)
(let ((res (gensym)) (n 0))
`(let (,res)
(setf ,res ,fun)
,(append (list 'progn)
(mapcar (lambda (arg)
`(setf ,arg (elt ,res ,(1- (incf n)))))
args))
)))
(let (a b c)
(splice (a b c) (list 1 2 3 4)))
This paste has no annotations.