+2008-10-20 Eli Zaretskii <eliz@gnu.org>
+
+ * subr.el (apply-partially): Move from here...
+
+ * simple.el (apply-partially): ...to here.
+
2008-10-20 Andreas Schwab <schwab@suse.de>
* subr.el (split-string-and-unquote): Simplify regexp.
;;; Code:
+;; This is for lexical-let in apply-partially.
+(eval-when-compile (require 'cl))
+
(declare-function widget-convert "wid-edit" (type &rest args))
(declare-function shell-mode "shell" ())
(if fh (apply fh 'start-file-process name buffer program program-args)
(apply 'start-process name buffer program program-args))))
-
\f
(defvar universal-argument-map
(let ((map (make-sparse-keymap)))
buffer-invisibility-spec)
(setq buffer-invisibility-spec nil)))
\f
+;; Partial application of functions (similar to "currying").
+(defun apply-partially (fun &rest args)
+ "Return a function that is a partial application of FUN to ARGS.
+ARGS is a list of the first N arguments to pass to FUN.
+The result is a new function which does the same as FUN, except that
+the first N arguments are fixed at the values with which this function
+was called."
+ (lexical-let ((fun fun) (args1 args))
+ (lambda (&rest args2) (apply fun (append args1 args2)))))
+\f
;; Minibuffer prompt stuff.
;(defun minibuffer-prompt-modification (start end)
\"1alpha\"."
(version-list-= (version-to-list v1) (version-to-list v2)))
-\f
-;; This is for lexical-let in apply-partially. It is here because cl
-;; needs various macros defined above.
-(eval-when-compile (require 'cl))
-
-(defun apply-partially (fun &rest args)
- "Return a function that is a partial application of FUN to ARGS.
-ARGS is a list of the first N arguments to pass to FUN.
-The result is a new function which does the same as FUN, except that
-the first N arguments are fixed at the values with which this function
-was called."
- (lexical-let ((fun fun) (args1 args))
- (lambda (&rest args2) (apply fun (append args1 args2)))))
-
-
;; arch-tag: f7e0e6e5-70aa-4897-ae72-7a3511ec40bc
;;; subr.el ends here