[Matthieu Moy]

> Anyone knows if it is possible in Emacs lisp to write something
> looking like
>
> (funcall 'f x y z t)
>
> with 'f being a function taking only three arguments ? 
>
> (The opposite of &optional :  allow more arguments and ignore the last
> ones). 

If 'f is declared to accept at most three arguments, I am not aware of
any solution.  However, if you're asking how to declare 'f in order to
facilitate it accepting more arguments than it really needs, that's
what the '&rest' keyword is for.  From the Elisp manual:

:    The keyword `&rest' (which will always be followed by a single
: parameter) indicates that any number of arguments can follow.  The value
: of the single following parameter will be a list of all these arguments.
: Do not write `&rest' when you call the function.

The Elisp '&rest' keyword is rather similar to the "def foo(*args)"
syntax in Python.
-- 
Harald

Reply via email to