Peter Szilagyi committed 1e0767c

renamed lambda free variables in elisp/core to partly handle dynamic binding in Emacs 23

Comments (0)

Files changed (1)


 (defun List.exists (p l)
   (if (List.find p l) t nil))
-(defun List.mem (l x)
-  (not (null (List.find (lambda (y) (equal x y)) l))))
+(defun List.mem (l x.List.mem)
+  (not (null (List.find (lambda (y) (equal x.List.mem y)) l))))
 (defun List.assoc (x l)
   (let ((res (assoc x l)))
 (defun List.iter (f l) (mapc f l) nil)
-(defun List.iteri (f l)
-  (let ((ctr 0))
+(defun List.iteri (f.List.iteri l)
+  (let ((ctr.List.iteri 0))
     (List.iter (lambda (x)
-                 (funcall f ctr x)
-                 (setq ctr (+ ctr 1))) l)))
+                 (funcall f.List.iteri ctr.List.iteri x)
+                 (incf ctr.List.iteri))
+               l)))
 (defun List.concat (l) (apply 'append l))
 (defun (f l) (mapcar f l))
-(defun List.mapi (f l)
-  (let ((i 0))
+(defun List.mapi (f.List.mapi l)
+  (let ((i.List.mapi 0))
     (mapcar (lambda (x)
-              (let ((y (funcall f i x)))
-                (setq i (1+ i))
+              (let ((y (funcall f.List.mapi i.List.mapi x)))
+                (incf i.List.mapi)
                 y)) l)))
 (defun List.upto-aux (n from acc)
 (defun List.concat-map (f l)
   (apply 'append ( f l)))
-(defun List.filter-map (f l)
+(defun List.filter-map (f.List.filter-map l)
   (List.foldr (lambda (x acc)
-                (let ((y (apply f (list x))))
+                (let ((y (apply f.List.filter-map (list x))))
                   (if y (cons y acc) acc)))
               () l))
-(defun List.partition (p l)
+(defun List.partition (p.List.partition l)
   (List.foldr (lambda (x acc)
                 (let ((yes (car acc))
                       (no  (cdr acc))
-                      (res (funcall p x)))
+                      (res (funcall p.List.partition x)))
                   (if res
                       (cons (cons x yes) no)
                     (cons yes (cons x no)))))
               (cons nil nil) l))
-(defun List.inter (l1 l2)
-  (List.filter (lambda (x) (List.mem l2 x)) l1))
+(defun List.inter (l1 l2.List.inter)
+  (List.filter (lambda (x) (List.mem l2.List.inter x)) l1))
-(defun List.intersperse (sep l)
+(defun List.intersperse (sep.List.intersperse l)
   (if (null l) l
     (cons (car l)
-          (apply 'append (mapcar (lambda (x) (list sep x)) (cdr l))))))
+          (apply 'append
+                 (mapcar (lambda (x)
+                           (list sep.List.intersperse x))
+                         (cdr l))))))
 (defun List.last (l)
   (car (last l)))
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.