Commit 28a17f34 authored by Juergen Nickelsen's avatar Juergen Nickelsen

greatly sped up (string ...) by making it use a single-list map

(The general mapcar is far more expensive.)
parent 0d899a6c
......@@ -249,7 +249,7 @@
(defun string (&rest args)
"make a string from all args and return it"
(apply #'concat (mapcar #'princs args)))
(apply #'concat (map #'princs args)))
(defun string<= (&rest args)
"return t if string args are in ascending order (non-strict), else nil"
......@@ -478,6 +478,13 @@
(apply #'all (cdr args))
nil)))
(defun map (func list)
"apply FUNC to each element of LIST and return the list of results"
(if (null list)
nil
(cons (func (car list))
(map func (cdr list)))))
(defun mapcar (fun &rest lists)
"apply FUN to all elements of all LISTS and return a list of the results"
(labels ((mapcar1 (fun arglist)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment