Created
June 2, 2017 16:00
-
-
Save Wilfred/16432886aacba566a7bb2e9ae283a923 to your computer and use it in GitHub Desktop.
Confusing Emacs argument parsing with cl-defun
This file contains 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
(cl-defun wh/foo (arg1 arg2 &key (kwarg1 t)) | |
(list arg1 arg2 kwarg1)) | |
;; We've forgotten arg2, but we get the error: | |
;; (error "Keyword argument 2 not one of (:kwarg1)") | |
(wh/foo 1 :kwarg1 2) | |
;; Instead, it would be clearer to say | |
;; "Expected a keyword argument (one of (:kwargs1)) but got 1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment