LispPad
  • Home
  • Applications
    • 🖥️LispPad
      • Sessions
      • Editor
      • Preferences
    • 📱LispPad Go
    • 📜Language
    • 📖Libraries
  • Libraries
    • ⚙️LispKit
      • (lispkit archive tar)
      • (lispkit archive zip)
      • (lispkit base)
      • (lispkit bitset)
      • (lispkit box)
      • (lispkit bytevector)
      • (lispkit char)
      • (lispkit char-set)
      • (lispkit combinator)
      • (lispkit comparator)
      • (lispkit control)
      • (lispkit core)
      • (lispkit crypto)
      • (lispkit csv)
      • (lispkit datatype)
      • (lispkit date-time)
      • (lispkit debug)
      • (lispkit disjoint-set)
      • (lispkit draw)
      • (lispkit draw turtle)
      • (lispkit draw barcode)
      • (lispkit draw chart bar)
      • (lispkit dynamic)
      • (lispkit enum)
      • (lispkit format)
      • (lispkit graph)
      • (lispkit gvector)
      • (lispkit hashtable)
      • (lispkit heap)
      • (lispkit http)
      • (lispkit http oauth)
      • (lispkit http server)
      • (lispkit iterate)
      • (lispkit json)
      • (lispkit json schema)
      • (lispkit list)
      • (lispkit list set)
      • (lispkit log)
      • (lispkit markdown)
      • (lispkit match)
      • (lispkit math)
      • (lispkit math matrix)
      • (lispkit math stats)
      • (lispkit math util)
      • (lispkit object)
      • (lispkit port)
      • (lispkit prolog)
      • (lispkit queue)
      • (lispkit record)
      • (lispkit regexp)
      • (lispkit serialize)
      • (lispkit set)
      • (lispkit sqlite)
      • (lispkit stack)
      • (lispkit stream)
      • (lispkit string)
      • (lispkit styled-text)
      • (lispkit system)
      • (lispkit system call)
      • (lispkit system keychain)
      • (lispkit system pasteboard)
      • (lispkit test)
      • (lispkit text-table)
      • (lispkit thread)
      • (lispkit thread channel)
      • (lispkit-thread-future)
      • (lispkit thread shared-queue)
      • (lispkit type)
      • (lispkit url)
      • (lispkit vector)
    • ⚙️LispPad
      • (lisppad applescript)
      • (lisppad draw map)
      • (lisppad location)
      • (lisppad speech)
      • (lisppad system)
      • (lisppad turtle)
    • ⚙️SRFI
  • Examples
    • 📝LispKit
    • 📝LispPad
    • 📝LispPad Go
  • Releases
    • 🖥️LispPad
    • 📱LispPad Go
  • Downloads
  • Privacy Policy
  • Contact
Powered by GitBook
On this page
  1. Libraries
  2. LispKit

(lispkit queue)

Last updated 6 months ago

Library (lispkit queue) provides an implementation for mutable queues, i.e. mutable FIFO buffers.

queue-type-tag

Symbol representing the queue type. The type-for procedure of library (lispkit type) returns this symbol for all queue objects.

(make-queue)

Returns a new empty queue.

(queue x ...)

Returns a new queue with x on its first position followed by the remaining parameters.

(dequeue! (queue 1 2 3))  ⇒ 1 

(queue? obj)

Returns #t if obj is a queue; otherwise #f is returned.

(queue-empty? q)

Returns #t if queue q is empty.

(queue-size q)

Returns the size of queue q, i.e. the number of elements buffered in q.

(queue=? q1 q2)

Returns #t if queue q1 has the exact same elements in the same order like queue q2; otherwise, #f is returned.

(enqueue! q x)

Inserts element x at the end of queue q.

Returns the first element in queue q. If the queue is empty, an error is raised.

Removes the first element from queue q and returns its value.

(define q (make-queue))
(enqueue! q 1)
(enqueue! q 2)
(dequeue! q)     ⇒ 1
(queue-front q)  ⇒ 2
(queue-size q)   ⇒ 1

Removes all elements from queue q.

Returns a copy of queue q.

Returns a list consisting of all elements in queue q in the order they were inserted, i.e. starting with the first element.

(define q (make-queue))
(enqueue! q 1)
(enqueue! q 2)
(enqueue! q 3)
(queue->list q)  ⇒ (1 2 3)

Returns a new queue consisting of the elements of list l. The first element in l will become the front element of the new queue that is returned.

(dequeue! (list->queue '(1 2 3)))  ⇒ 1

Inserts the elements of list l into queue q in the order they appear in the list.

(define q (list->queue '(1 2 3)))
(list->queue! q '(4 5 6))
(queue->list q)  ⇒ (1 2 3 4 5 6)

(queue-front q)

(dequeue! q)

(queue-clear! q)

(queue-copy q)

(queue->list q)

(list->queue l)

(list->queue! s l)

⚙️