From: Hugo Duncan <hugo_duncan@ya...> - 2008-05-31 13:35:15
> Thanks! Question: why not just
> (defun empty-queue-p (queue)
> (eq (queue-head qeue) (queue-tail queue)))
>From the paper,
"The situation in which there is only one node in the queue is encountered
when the tail and head point to the same node, which is not a dummy node."
So I think my cond can be simplified to :
(and (eq tail head)(eq val +dummy+))
On Sat, May 31, 2008 at 2:42 PM, Hugo Duncan <hugo_duncan@...> wrote:
> Attached a small patch which adds an empty queue predicate. Useful for asserting that the queue is empty, and for use as a rudimentary form of synchronisation.
Thanks! Question: why not just
(defun empty-queue-p (queue)
(eq (queue-head qeue) (queue-tail queue)))
? I'm not saying that I have fully thought this through, but it seems
to me that this would be correct.