emacs - How to define a function with a variable number of arguments? -


instead of this:

((lambda (a b) (apply '+ (list b)))  1 2) 

it possible write in scheme:

((lambda args (apply '+ args))  1 2) 

now possible pass more 2 arguments function.

when try in emacs lisp error: invalid function.

how define function in emacs lisp?

in emacs lisp, can put &rest in argument list of function, remaining arguments list:

(lambda (&rest args) (apply '+ args)) 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -