Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun extract-options (list)
- (iter (for rest on list by #'cddr)
- (while (keywordp (first rest)))
- (collect (list (first rest) (second rest)) into args)
- (finally (return (values args rest)))))
- (extract-options '(:h 0 :w 2 (hello-world) (expr)))
- ;; => ((:H 0) (:W 2)), ((HELLO-WORLD) (EXPR))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement