Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun mixed (arg1 &rest arguments &aux (arg3 24) arg3-supplied (arg2 30) arg2-supplied)
- (loop :while arguments
- :do (case (first arguments)
- (:arg3
- (pop arguments)
- (unless arguments (error "Missing argument after :arg3"))
- (setf arg3 (pop arguments) arg3-supplied t))
- (otherwise
- (cond
- ((not arg2-supplied) (setf arg2 (pop arguments) arg2-supplied t))
- (t (error "Too many arguments, remaining: ~S" arguments))))))
- (list arg1 arg2 arg3 arg2-supplied arg3-supplied))
- (mixed 22 44) --> (22 44 24 t nil)
- (mixed 22 44 :arg3 33) --> (22 44 33 t t)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement