summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--control-flow.lisp18
-rw-r--r--list-functions-2.lisp2
-rw-r--r--list-functions.lisp10
3 files changed, 20 insertions, 10 deletions
diff --git a/control-flow.lisp b/control-flow.lisp
index cb4f329..5552e96 100644
--- a/control-flow.lisp
+++ b/control-flow.lisp
@@ -106,10 +106,10 @@
(cond
((atom clause)
(when current-function
- (push (cons current-label current-function)
- labels-and-functions)
- (push (cons current-label catch-tag)
- labels-and-catch-tags))
+ (pushq (cons current-label current-function)
+ labels-and-functions)
+ (pushq (cons current-label catch-tag)
+ labels-and-catch-tags))
(let ((old-function current-function))
(setq current-label clause
current-function (gensym))
@@ -121,14 +121,14 @@
`(,current-function ()
',end-marker)))
(setq accumulated-clauses nil))))
- (t (push clause accumulated-clauses)
+ (t (pushq clause accumulated-clauses)
(if (endp rest)
(progn
(when current-function
- (push (cons current-label current-function)
- labels-and-functions)
- (push (cons current-label catch-tag)
- labels-and-catch-tags))
+ (pushq (cons current-label current-function)
+ labels-and-functions)
+ (pushq (cons current-label catch-tag)
+ labels-and-catch-tags))
`((,current-function ()
,@(nreverse accumulated-clauses)
',end-marker)))
diff --git a/list-functions-2.lisp b/list-functions-2.lisp
index 09003a4..6121f71 100644
--- a/list-functions-2.lisp
+++ b/list-functions-2.lisp
@@ -20,7 +20,7 @@
(export '(copy-tree assoc assoc-if assoc-if-not rassoc rassoc-if
rassoc-if-not sublis nsublis mapcar mapcan mapcon acons
- reverse nreverse))
+ reverse nreverse maplist))
(defun copy-tree (tree)
diff --git a/list-functions.lisp b/list-functions.lisp
index 1fe749b..29d913f 100644
--- a/list-functions.lisp
+++ b/list-functions.lisp
@@ -236,3 +236,13 @@
;;;;-----------------------------------------------------------------
+;;;; UTILITIES
+;;;;-----------------------------------------------------------------
+(defmacro pushq (thing variable)
+ (let ((tmp (gensym)))
+ `(let ((,tmp ,thing))
+ (setq ,variable (cons ,tmp ,variable))
+ ,tmp)))
+
+
+;;;;-----------------------------------------------------------------