diff lisp/subr.el @ 783:6fadd0a2230b

[xemacs-hg @ 2002-03-19 02:38:51 by ben] memory usage fun
author ben
date Tue, 19 Mar 2002 02:38:51 +0000
parents e65d9cf16707
children e38acbeb1cae
line wrap: on
line diff
--- a/lisp/subr.el	Mon Mar 18 22:22:15 2002 +0000
+++ b/lisp/subr.el	Tue Mar 19 02:38:51 2002 +0000
@@ -611,6 +611,15 @@
       (setq plist (cddr plist)))
     (nreverse alist)))
 
+(defun map-plist (_mp_fun _mp_plist)
+  "Map _MP_FUN (a function of two args) over each key/value pair in _MP_PLIST.
+Return a list of the results."
+  (let (_mp_result)
+    (while _mp_plist
+      (push (funcall _mp_fun (car _mp_plist) (cadr _mp_plist)) _mp_result)
+      (setq _mp_plist (cddr _mp_plist)))
+    (nreverse _mp_result)))
+
 (defun destructive-plist-to-alist (plist)
   "Convert property list PLIST into the equivalent association-list form.
 The alist is returned.  This converts from