aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorTino Calancha2017-03-03 08:37:23 +0900
committerTino Calancha2017-03-03 08:37:23 +0900
commit6a9ba271a956127e566192b33fc811e802d2d475 (patch)
tree496ce7b26947f64cd3baacc80cb62636a3be6ff6 /lisp
parent56aaaf9bbaf9772ea714b16aa7ed2a9693ac92e3 (diff)
downloademacs-6a9ba271a956127e566192b33fc811e802d2d475.tar.gz
emacs-6a9ba271a956127e566192b33fc811e802d2d475.zip
* lisp/subr.el (apply-partially): Move to 'Basic Lisp functions' section.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/subr.el18
1 files changed, 9 insertions, 9 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index 4f848d1400c..6b0403890cf 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -132,15 +132,6 @@ buffer-local wherever it is set."
132 (list 'progn (list 'defvar var val docstring) 132 (list 'progn (list 'defvar var val docstring)
133 (list 'make-variable-buffer-local (list 'quote var)))) 133 (list 'make-variable-buffer-local (list 'quote var))))
134 134
135(defun apply-partially (fun &rest args)
136 "Return a function that is a partial application of FUN to ARGS.
137ARGS is a list of the first N arguments to pass to FUN.
138The result is a new function which does the same as FUN, except that
139the first N arguments are fixed at the values with which this function
140was called."
141 (lambda (&rest args2)
142 (apply fun (append args args2))))
143
144(defmacro push (newelt place) 135(defmacro push (newelt place)
145 "Add NEWELT to the list stored in the generalized variable PLACE. 136 "Add NEWELT to the list stored in the generalized variable PLACE.
146This is morally equivalent to (setf PLACE (cons NEWELT PLACE)), 137This is morally equivalent to (setf PLACE (cons NEWELT PLACE)),
@@ -344,6 +335,15 @@ configuration."
344 (and (consp object) 335 (and (consp object)
345 (eq (car object) 'frame-configuration))) 336 (eq (car object) 'frame-configuration)))
346 337
338(defun apply-partially (fun &rest args)
339 "Return a function that is a partial application of FUN to ARGS.
340ARGS is a list of the first N arguments to pass to FUN.
341The result is a new function which does the same as FUN, except that
342the first N arguments are fixed at the values with which this function
343was called."
344 (lambda (&rest args2)
345 (apply fun (append args args2))))
346
347 347
348;;;; List functions. 348;;;; List functions.
349 349