From 440652a2a6b4d2e1cf121f802d026de4ed83614b Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sun, 3 Aug 2008 01:02:22 +0200 Subject: Add PUSHQ. --- control-flow.lisp | 18 +++++++++--------- list-functions-2.lisp | 2 +- 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 @@ -235,4 +235,14 @@ ,result)) +;;;;----------------------------------------------------------------- +;;;; UTILITIES +;;;;----------------------------------------------------------------- +(defmacro pushq (thing variable) + (let ((tmp (gensym))) + `(let ((,tmp ,thing)) + (setq ,variable (cons ,tmp ,variable)) + ,tmp))) + + ;;;;----------------------------------------------------------------- -- cgit v1.2.3