From 5bd4593d7737afc555ba84104e1eeb5607615f9d Mon Sep 17 00:00:00 2001 From: Magnar Sveen Date: Sat, 20 Oct 2012 10:29:41 +0200 Subject: [PATCH] Add note about !rpartial only working on Emacs 24+ --- bang.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bang.el b/bang.el index 81c2350..9463198 100644 --- a/bang.el +++ b/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. When called, the returned function calls FN with ARGS first and then additional args." - `(closure (t) (&rest args) - (apply ',fn ,@(mapcar (lambda (arg) `',arg) args) args))) + (apply 'apply-partially fn args)) (defun !rpartial (fn &rest args) "Takes a function FN and fewer than the normal arguments to FN, and returns a fn that takes a variable number of additional ARGS. 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) (apply ',fn (append args ',args))))