Add note about !rpartial only working on Emacs 24+

master
Magnar Sveen 14 years ago
parent 047eeea939
commit 5bd4593d77
  1. 7
      bang.el

@ -143,14 +143,15 @@ Thus function FN should return a collection."
and returns a fn that takes a variable number of additional ARGS. and returns a fn that takes a variable number of additional ARGS.
When called, the returned function calls FN with ARGS first and When called, the returned function calls FN with ARGS first and
then additional args." then additional args."
`(closure (t) (&rest args) (apply 'apply-partially fn args))
(apply ',fn ,@(mapcar (lambda (arg) `',arg) args) args)))
(defun !rpartial (fn &rest args) (defun !rpartial (fn &rest args)
"Takes a function FN and fewer than the normal arguments to FN, "Takes a function FN and fewer than the normal arguments to FN,
and returns a fn that takes a variable number of additional ARGS. and returns a fn that takes a variable number of additional ARGS.
When called, the returned function calls FN with the additional When called, the returned function calls FN with the additional
args first and then ARGS." args first and then ARGS.
Requires Emacs 24 or higher."
`(closure (t) (&rest args) `(closure (t) (&rest args)
(apply ',fn (append args ',args)))) (apply ',fn (append args ',args))))

Loading…
Cancel
Save