| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
util.queue - Queue
SLIB (See section 11.15 slib - SLIB interface) provides the queue library that is safer.
This API is upper compatible to the SLIB's.
The idea is that this queue is used inside other procedure or
structure that you know you don't need the strict checks.
Use either one depending on your requirement.
#t if obj is a queue. This operation checks
obj is really in a shape of the queue.
#t if obj is an empty queue.
queue-pop! may be used to
emphasize it works with queue-push!. An error is signalled
if queue is empty.
queue->list below.
dequeue-all!, the content of queue remains intact.
In Gauche, queue->list copies the content of the queue to a
freshly allocated list, while dequeue-all! doesn't copy but
directly returns the queue's internal list. There are some Scheme
systems that has queue->list but doesn't guarantee the content
is copied, so if you're planning to share the code among these
implementations, it's better not to rely on the fact that
queue->list copies the content.
find in SRFI-1 (See section 10.2.7 List searching).
#t if any item is removed. Otherwise returns #f.
The order of arguments follows
remove in SRFI-1 (See section 10.2.6 List filtering & partitioning).
Note on portability:
Scheme48 has delete-from-queue!, which takes object to remove
rather than predicate, and also takes arguments in reversed order
(i.e. queue comes first). Avoid conflicting with that I intentionally
left out delete-from-queue!; it's easy to write one in either
Scheme48 compatible way or consistent to SRFI-1 argument order.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |