bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#40596: 28.0.50; Function with more than one key gives "wrong number


From: Eli Zaretskii
Subject: bug#40596: 28.0.50; Function with more than one key gives "wrong number of arguments" error
Date: Mon, 13 Apr 2020 15:30:21 +0300

> From: Jean Louis <bugs@gnu.support>
> Date: Mon, 13 Apr 2020 14:19:10 +0300
> 
> Here is something that could be a bug, I cannot know at this moment, as
> I am researching yet if I can use &key with Emacs's `defun':
> 
> (defun tmp-function-1 (text html &key one)
>   "This one works fine"
>   (message one))
> 
> (tmp-function-1 "text" "<html>" :one "Hello")
> 
> (defun tmp-function-2 (text html &key one two)
>   "This one does not work, wrong number of arguments"
>   (message one))
> 
> (tmp-function-1 "text" "<html>" :one "Hello" :two "But not alright")
> 
> Evaluating the last function does not work, it gives the error:

You need to use cl-defun, not defun.  The latter doesn't support &key.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]