Created
November 13, 2012 13:01
-
-
Save anton0xf/4065651 to your computer and use it in GitHub Desktop.
inverted optional
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun test(&rest ab) | |
| (let ((len (length ab)) | |
| (a 2) b) | |
| (cond ((< 2 len) (error "Too many args")) | |
| ((= 2 len) | |
| (setf a (first ab) | |
| b (second ab))) | |
| ((= 1 len) (setf b (first ab))) | |
| (t (error "B arg is mandatory"))) | |
| (format t "a: ~W, b: ~W~%" a b))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment