diff options
author | Matthias Andreas Benkard <matthias@benkard.de> | 2008-08-03 01:02:22 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <matthias@benkard.de> | 2008-08-03 01:02:22 +0200 |
commit | 440652a2a6b4d2e1cf121f802d026de4ed83614b (patch) | |
tree | 52e256239379f1d0f059f7f40db4625ac61bf70b | |
parent | 6ed66892fe330fb8e422923993b262b44533bdb5 (diff) |
Add PUSHQ.
-rw-r--r-- | control-flow.lisp | 18 | ||||
-rw-r--r-- | list-functions-2.lisp | 2 | ||||
-rw-r--r-- | list-functions.lisp | 10 |
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))) + + +;;;;----------------------------------------------------------------- |