Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defmacro with-list-iterator ((name list-form) &body body)
- (let ((var (gensym)))
- `(let ((,var ,list-form))
- (symbol-macrolet ((,name (pop ,var)))
- ,@body))))
- (defmacro with-list-iterator2 ((name list-form) &body body)
- (let ((var '#:x))
- `(let ((,var ,list-form))
- (symbol-macrolet ((,name (pop ,var)))
- ,@body))))
- (with-list-iterator (hello '(a b c))
- (with-list-iterator (hi '(d e f))
- (list (list hello hi) (list hello hi) )))
- (with-list-iterator2 (hello '(a b c))
- (with-list-iterator2 (hi '(d e f))
- (list (list hello hi) (list hello hi) )))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement