Common Lisp Package: CL-SPEEDY-QUEUE

README:

About

cl-speedy-queue is a portable, non-consing, optimized queue implementation. It was originally written by Adlai Chandrasekhar for use in ChanL.

API

[function]make-queue size

Creates a new queue of SIZE.

[function]enqueue object queue

Enqueues OBJECT in QUEUE.

[function]dequeue queue

Dequeues QUEUE.

[function]queue-count queue

Returns the current size of QUEUE.

[function]queue-length queue

Returns the maximum size of QUEUE.

[function]queue-peek queue

Returns the next item that would be dequeued without dequeueing it.

[function]queue-full-p queue

Returns NIL if more items can be enqueued.

[function]queue-empty-p queue

Returns NIL if there are still items in the queue.

FUNCTION

Public

DEQUEUE (QUEUE)

Dequeues QUEUE

ENQUEUE (OBJECT QUEUE)

Enqueues OBJECT in QUEUE

MAKE-QUEUE (SIZE)

Makes a queue of maximum size SIZE

QUEUE-COUNT (QUEUE)

Returns the current size of QUEUE

QUEUE-EMPTY-P (QUEUE)

Tests whether QUEUE is empty

QUEUE-FULL-P (QUEUE)

Returns NIL if more items can be enqueued.

QUEUE-LENGTH (QUEUE)

Returns the maximum size of QUEUE

QUEUE-PEEK (QUEUE)

Returns the next item that would be dequeued without dequeueing it.

Private

%DEQUEUE

Sets QUEUE's tail to QUEUE, increments QUEUE's tail pointer, and returns the previous tail ref

%ENQUEUE

Enqueue OBJECT and increment QUEUE's entry pointer

%MAKE-QUEUE

Creates a new queue of maximum size LENGTH

%QUEUE-COUNT

Returns QUEUE's effective length

%QUEUE-EMPTY-P

Checks whether QUEUE is effectively empty

%QUEUE-FULL-P

Checks whether QUEUE is effectively full

%QUEUE-IN

QUEUE's entry pointer

%QUEUE-LENGTH

Returns QUEUE's maximum length

%QUEUE-OUT

QUEUE's exit pointer

%QUEUE-PEEK

Dereference QUEUE's exit pointer

%QUEUE-ZERO-P

Checks whether QUEUE's theoretical length is zero

QUEUEP

If this returns NIL, X is not a queue

Undocumented

%NEXT-INDEX

MACRO

Private

Undocumented

DEFINE-SPEEDY-FUNCTION (NAME ARGS &BODY BODY)

GENERIC-FUNCTION

Private

Undocumented

QUEUE-CONDITION-QUEUE (CONDITION)

QUEUE-ERROR-ATTEMPTED-LENGTH (CONDITION)

QUEUE-OVERFLOW-EXTRA-ITEM (CONDITION)

CONDITION

Private

Undocumented

QUEUE-CONDITION

QUEUE-LENGTH-ERROR

QUEUE-OVERFLOW-ERROR

QUEUE-UNDERFLOW-ERROR