diff options
| author | Tino Calancha | 2017-03-03 08:37:23 +0900 |
|---|---|---|
| committer | Tino Calancha | 2017-03-03 08:37:23 +0900 |
| commit | 6a9ba271a956127e566192b33fc811e802d2d475 (patch) | |
| tree | 496ce7b26947f64cd3baacc80cb62636a3be6ff6 /lisp | |
| parent | 56aaaf9bbaf9772ea714b16aa7ed2a9693ac92e3 (diff) | |
| download | emacs-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.el | 18 |
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. | ||
| 137 | ARGS is a list of the first N arguments to pass to FUN. | ||
| 138 | The result is a new function which does the same as FUN, except that | ||
| 139 | the first N arguments are fixed at the values with which this function | ||
| 140 | was 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. |
| 146 | This is morally equivalent to (setf PLACE (cons NEWELT PLACE)), | 137 | This 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. | ||
| 340 | ARGS is a list of the first N arguments to pass to FUN. | ||
| 341 | The result is a new function which does the same as FUN, except that | ||
| 342 | the first N arguments are fixed at the values with which this function | ||
| 343 | was called." | ||
| 344 | (lambda (&rest args2) | ||
| 345 | (apply fun (append args args2)))) | ||
| 346 | |||
| 347 | 347 | ||
| 348 | ;;;; List functions. | 348 | ;;;; List functions. |
| 349 | 349 | ||