(index ("make-list-queue" 0) ("list-queue" 860) ("list-queue-copy" 1064) ("list-queue-unfold" 1304) ("list-queue-unfold-right" 1892) ("list-queue?" 2486) ("list-queue-empty?" 2663) ("list-queue-front" 2866) ("list-queue-back" 3070) ("list-queue-list" 3271) ("list-queue-first-last" 3509) ("list-queue-add-front!" 3859) ("list-queue-add-back!" 4071) ("list-queue-remove-front!" 4275) ("list-queue-remove-back!" 4510) ("list-queue-remove-all!" 4836) ("list-queue-set-list!" 5043) ("list-queue-append" 5695) ("list-queue-append!" 6052) ("list-queue-concatenate" 6584) ("list-queue-map" 7169) ("list-queue-map!" 7476) ("list-queue-for-each" 7904))
(def (sig (procedure "(make-list-queue list [last])" (id make-list-queue))) (p "Returns a newly allocated list queue containing the elements of " (tt "list") " in order.  The result shares storage with " (tt "list") ". If the last argument is not provided, this operation is O(n) where n is the length of " (tt "list") ".") (p "However, if last is provided, " (tt "make-list-queue") " returns a newly allocated list queue containing the elements of the " (tt "list") " whose first pair is first and whose last pair is last. It is an error if the pairs do not belong to the same list. Alternatively, both first and last can be the empty list. In either case, the operation is O(1).") (p (b "Note:") " To apply a non-destructive list procedure to a list queue and return a new list queue, use " (tt "(make-list-queue (proc (list-queue-list list-queue)))") "."))
(def (sig (procedure "(list-queue element ...)" (id list-queue))) (p "Returns a newly allocated list queue containing the " (tt "elements") ". This operation is O(n) where n is the number of elements."))
(def (sig (procedure "(list-queue-copy list-queue)" (id list-queue-copy))) (p "Returns a newly allocated list queue containing the elements of " (tt "list-queue") ". This operation is O(n) where n is the length of " (tt "list-queue") "."))
(def (sig (procedure "(list-queue-unfold stop? mapper successor seed [queue])" (id list-queue-unfold))) (p "Performs the following algorithm:") (p "If the result of applying the predicate " (tt "stop?") " to " (tt "seed") " is true, return " (tt "queue") ".  Otherwise, apply the procedure " (tt "mapper") " to " (tt "seed") ", returning a value which is added to the front of " (tt "queue") ". Then get a new seed by applying the procedure " (tt "successor") " to " (tt "seed") ", and repeat this algorithm.") (p "If " (tt "queue") " is omitted, a newly allocated list queue is used."))
(def (sig (procedure "(list-queue-unfold-right stop? mapper successor seed [queue])" (id list-queue-unfold-right))) (p "Performs the following algorithm:") (p "If the result of applying the predicate " (tt "stop?") " to " (tt "seed") " is true, return the list queue. Otherwise, apply the procedure " (tt "mapper") " to " (tt "seed") ", returning a value which is added to the back of the list queue. Then get a new seed by applying the procedure " (tt "successor") " to " (tt "seed") ", and repeat this algorithm.") (p "If " (tt "queue") " is omitted, a newly allocated list queue is used."))
(def (sig (procedure "(list-queue? obj)" (id list-queue?))) (p "Returns " (tt "#t") " if " (tt "obj") " is a list queue, and " (tt "#f") " otherwise. This operation is O(1)."))
(def (sig (procedure "(list-queue-empty? list-queue)" (id list-queue-empty?))) (p "Returns " (tt "#t") " if " (tt "list-queue") " has no elements, and " (tt "#f") " otherwise. This operation is O(1)."))
(def (sig (procedure "(list-queue-front list-queue)" (id list-queue-front))) (p "Returns the first element of " (tt "list-queue") ". If the list queue is empty, it is an error. This operation is O(1)."))
(def (sig (procedure "(list-queue-back list-queue)" (id list-queue-back))) (p "Returns the last element of " (tt "list-queue") ". If the list queue is empty, it is an error. This operation is O(1)."))
(def (sig (procedure "(list-queue-list list-queue)" (id list-queue-list))) (p "Returns the list that contains the members of " (tt "list-queue") " in order. The result shares storage with " (tt "list-queue") ". This operation is O(1)."))
(def (sig (procedure "(list-queue-first-last list-queue)" (id list-queue-first-last))) (p "Returns two values, the first and last pairs of the list that contains the members of " (tt "list-queue") " in order. If " (tt "list-queue") " is empty, returns two empty lists. The results share storage with " (tt "list-queue") ". This operation is O(1)."))
(def (sig (procedure "(list-queue-add-front! list-queue element)" (id list-queue-add-front!))) (p "Adds element to the beginning of " (tt "list-queue") ". Returns an unspecified value. This operation is O(1)."))
(def (sig (procedure "(list-queue-add-back! list-queue element)" (id list-queue-add-back!))) (p "Adds element to the end of " (tt "list-queue") ". Returns an unspecified value. This operation is O(1)."))
(def (sig (procedure "(list-queue-remove-front! list-queue)" (id list-queue-remove-front!))) (p "Removes the first element of " (tt "list-queue") " and returns it. If the list queue is empty, it is an error. This operation is O(1)."))
(def (sig (procedure "(list-queue-remove-back! list-queue)" (id list-queue-remove-back!))) (p "Removes the last element of " (tt "list-queue") " and returns it. If the list queue is empty, it is an error. This operation is O(n) where n is the length of " (tt "list-queue") ", because queues do not not have backward links."))
(def (sig (procedure "(list-queue-remove-all! list-queue)" (id list-queue-remove-all!))) (p "Removes all the elements of " (tt "list-queue") " and returns them in order as a list. This operation is O(1)."))
(def (sig (procedure "(list-queue-set-list! list-queue list [last])" (id list-queue-set-list!))) (p "Replaces the list associated with " (tt "list-queue") " with " (tt "list") ", effectively discarding all the elements of " (tt "list-queue") " in favor of those in " (tt "list") ". Returns an unspecified value. This operation is O(n) where n is the length of " (tt "list") ". If " (tt "last") " is provided, it is treated in the same way as in " (tt "make-list-queue") ", and the operation is O(1).") (p (b "Note:") " To apply a destructive list procedure to a list queue, use " (tt "(list-queue-set-list! (proc (list-queue-list list-queue)))") "."))
(def (sig (procedure "(list-queue-append list-queue ...)" (id list-queue-append))) (p "Returns a list queue which contains all the elements in front-to-back order from all the " (tt "list-queues") " in front-to-back order. The result does not share storage with any of the arguments. This operation is O(n) in the total number of elements in all queues."))
(def (sig (procedure "(list-queue-append! list-queue ...)" (id list-queue-append!))) (p "Returns a list queue which contains all the elements in front-to-back order from all the " (tt "list-queue") "s in front-to-back order. It is an error to assume anything about the contents of the " (tt "list-queue") "s after the procedure returns. This operation is O(n) in the total number of queues, not elements. It is not part of the R7RS-small list API, but is included here for efficiency when pure functional append is not required."))
(def (sig (procedure "(list-queue-concatenate list-of-list-queues)" (id list-queue-concatenate))) (p "Returns a list queue which contains all the elements in front-to-back order from all the list queues which are members of " (tt "list-of-list-queues") " in front-to-back order. The result does not share storage with any of the arguments. This operation is O(n) in the total number of elements in all queues. It is not part of the R7RS-small list API, but is included here to make appending a large number of queues possible in Schemes that limit the number of arguments to apply."))
(def (sig (procedure "(list-queue-map proc list-queue)" (id list-queue-map))) (p "Applies " (tt "proc") " to each element of " (tt "list-queue") " in unspecified order and returns a newly allocated list queue containing the results. This operation is O(n) where n is the length of " (tt "list-queue") "."))
(def (sig (procedure "(list-queue-map! proc list-queue)" (id list-queue-map!))) (p "Applies " (tt "proc") " to each element of " (tt "list-queue") " in front-to-back order and modifies " (tt "list-queue") " to contain the results. This operation is O(n) in the length of " (tt "list-queue") ". It is not part of the R7RS-small list API, but is included here to make transformation of a list queue by mutation more efficient."))
(def (sig (procedure "(list-queue-for-each proc list-queue)" (id list-queue-for-each))) (p "Applies " (tt "proc") " to each element of " (tt "list-queue") " in front-to-back order, discarding the returned values. Returns an unspecified value. This operation is O(n) where n is the length of " (tt "list-queue") "."))
