summaryrefslogtreecommitdiffstats
path: root/queue.txi
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:29 -0800
committerBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:29 -0800
commit8466d8cfa486fb30d1755c4261b781135083787b (patch)
treec8c12c67246f543c3cc4f64d1c07e003cb1d45ae /queue.txi
parent87b82b5822ca54228cfa6df29be3ad9d4bc47d16 (diff)
downloadslib-8466d8cfa486fb30d1755c4261b781135083787b.tar.gz
slib-8466d8cfa486fb30d1755c4261b781135083787b.zip
Import Upstream version 3a1upstream/3a1
Diffstat (limited to 'queue.txi')
-rw-r--r--queue.txi60
1 files changed, 60 insertions, 0 deletions
diff --git a/queue.txi b/queue.txi
new file mode 100644
index 0000000..4590f34
--- /dev/null
+++ b/queue.txi
@@ -0,0 +1,60 @@
+@code{(require 'queue)}
+@ftindex queue
+
+A @dfn{queue} is a list where elements can be added to both the front
+@cindex queue
+and rear, and removed from the front (i.e., they are what are often
+called @dfn{dequeues}). A queue may also be used like a stack.
+@cindex dequeues
+
+
+@defun make-queue
+
+Returns a new, empty queue.
+@end defun
+
+@defun queue? obj
+
+Returns @code{#t} if @var{obj} is a queue.
+@end defun
+
+@defun queue-empty? q
+
+Returns @code{#t} if the queue @var{q} is empty.
+@end defun
+
+@deffn {Procedure} queue-push! q datum
+
+Adds @var{datum} to the front of queue @var{q}.
+@end deffn
+
+@deffn {Procedure} enqueue! q datum
+
+Adds @var{datum} to the rear of queue @var{q}.
+@end deffn
+
+@deffn {Procedure} dequeue! q
+
+@deffnx {Procedure} queue-pop! q
+Both of these procedures remove and return the datum at the front of
+the queue. @code{queue-pop!} is used to suggest that the queue is
+being used like a stack.
+@end deffn
+All of the following functions raise an error if the queue @var{q}
+is empty.
+
+
+@deffn {Procedure} dequeue-all! q
+
+Removes and returns (the list) of all contents of queue @var{q}.
+@end deffn
+
+@defun queue-front q
+
+Returns the datum at the front of the queue @var{q}.
+@end defun
+
+@defun queue-rear q
+
+Returns the datum at the rear of the queue @var{q}.
+@end defun