Add POP macro
[jscl.git] / src / list.lisp
index f1d5afb..ddaeb56 100644 (file)
@@ -54,3 +54,9 @@
      (cons (subst new old (car tree) :key key :test test)
            (subst new old (cdr tree) :key key :test test))) 
     (t tree)))
+
+(defmacro pop (place)
+  (let ((car-symbol (gensym)))
+    `(let ((,car-symbol (car ,place)))
+       (setf ,place (cdr ,place))
+       ,car-symbol)))