RefQ: CEDAR DEFINITIONS = { Queue: TYPE = LIST OF REF; Enqueue: PROC [queue: Queue, value: REF] RETURNS [qPlusValue: Queue]; EnqueueQ: PROC [queue: Queue, newQ: LIST OF REF] RETURNS [longerQ: Queue]; DequeueMode: TYPE = { remove, truncate }; Dequeue: PROC [queue: Queue, value: REF] RETURNS [shorterQ: Queue]; DequeueQ: PROC [queue: Queue, subqueue: Queue_NIL, mode: DequeueMode_remove] RETURNS [shorterQ: Queue]; MapType: TYPE = PROC[subqueue: Queue] RETURNS[quit: BOOL_FALSE]; Map: PROC[queue: Queue, p: MapType] RETURNS[quit: BOOL]; }. XRefQ.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Swinehart, December 18, 1985 3:21:42 pm PST Routines for manipulating a simple one-way Queue of REF's (simulates tail-pointer, since queues are expected to be short). Monitors must be provided by clients. Clients can read the queue as a LIST OF REF, which it is. Adds the element to the tail of the queue. Appends the list to the tail of the queue. Removes the first instance of the element value from the queue, if any. Removes one or more elements. subqueue.first is the element to be removed. mode: remove  remove subqueue.first from the queue. truncate, removes all values from the head of the queue to and including the indicated element. Applies p to each sublist of queue. Client is also allowed to do this directly. Returns TRUE iff some call to p returns TRUE Κ_˜šœ ™ Icodešœ Οmœ1™