[Bese-devel] arnesi patch queue->list
Chris Dean
ctdean at sokitomi.com
Tue May 16 18:20:34 UTC 2006
Patch attached for a function that transforms a queue into a list.
Thanks for arnesi - I use it everyday!
Regards,
Chris Dean
diff -rN -u old-arnesi/src/packages.lisp new-arnesi/src/packages.lisp
--- old-arnesi/src/packages.lisp 2006-05-16 11:10:59.000000000 -0700
+++ new-arnesi/src/packages.lisp 2006-05-16 11:10:59.000000000 -0700
@@ -251,6 +251,7 @@
#:peek-queue
#:queue-empty-p
#:queue-count
+ #:queue->list
#:lru-queue
;; decimal arith
diff -rN -u old-arnesi/src/queue.lisp new-arnesi/src/queue.lisp
--- old-arnesi/src/queue.lisp 2006-05-16 11:10:59.000000000 -0700
+++ new-arnesi/src/queue.lisp 2006-05-16 11:10:59.000000000 -0700
@@ -117,6 +117,12 @@
(print-unreadable-object (queue stream :type t :identity t)
(format stream "~D" (queue-count queue))))
+(defmethod queue->list ((queue queue))
+ (let ((res nil))
+ (do-all-elements (element queue)
+ (push element res))
+ (nreverse res)))
+
;;;; ** LRU Queue
(defclass lru-queue (queue)
More information about the bese-devel
mailing list