# QueueAggregate SΒΆ

aggcat.spad line 325 [edit on github]

S: Type

A queue is a bag where the first item inserted is the first item extracted.

- #: % -> NonNegativeInteger
from Aggregate

- any?: (S -> Boolean, %) -> Boolean
from HomogeneousAggregate S

- back: % -> S
`back(q)`

returns the element at the back of the queue. The queue`q`

is unchanged by this operation. Error: if`q`

is empty.

- coerce: % -> OutputForm if S has CoercibleTo OutputForm
from CoercibleTo OutputForm

- construct: List S -> %
from Collection S

- convert: % -> InputForm if S has ConvertibleTo InputForm
from ConvertibleTo InputForm

- count: (S -> Boolean, %) -> NonNegativeInteger
from HomogeneousAggregate S

- count: (S, %) -> NonNegativeInteger if S has BasicType
from HomogeneousAggregate S

- dequeue!: % -> S
`dequeue!(q)`

destructively extracts the first (top) element from queue`q`

. The element previously second in the queue becomes the first element. Error: if`q`

is empty.

- enqueue!: (S, %) -> S
`enqueue!(x, q)`

inserts`x`

into the queue`q`

at the back end.

- eval: (%, Equation S) -> % if S has SetCategory and S has Evalable S
from Evalable S

- eval: (%, List Equation S) -> % if S has SetCategory and S has Evalable S
from Evalable S

- eval: (%, List S, List S) -> % if S has SetCategory and S has Evalable S
from InnerEvalable(S, S)

- eval: (%, S, S) -> % if S has SetCategory and S has Evalable S
from InnerEvalable(S, S)

- every?: (S -> Boolean, %) -> Boolean
from HomogeneousAggregate S

- extract!: % -> S
from BagAggregate S

- find: (S -> Boolean, %) -> Union(S, failed)
from Collection S

- front: % -> S
`front(q)`

returns the element at the front of the queue. The queue`q`

is unchanged by this operation. Error: if`q`

is empty.

- hash: % -> SingleInteger if S has Hashable
from Hashable

- hashUpdate!: (HashState, %) -> HashState if S has Hashable
from Hashable

- insert!: (S, %) -> %
from BagAggregate S

- inspect: % -> S
from BagAggregate S

- latex: % -> String if S has SetCategory
from SetCategory

- less?: (%, NonNegativeInteger) -> Boolean
from Aggregate

- map!: (S -> S, %) -> %
from HomogeneousAggregate S

- map: (S -> S, %) -> %
from HomogeneousAggregate S

- max: % -> S if S has OrderedSet
from HomogeneousAggregate S

- max: ((S, S) -> Boolean, %) -> S
from HomogeneousAggregate S

- member?: (S, %) -> Boolean if S has BasicType
from HomogeneousAggregate S

- members: % -> List S
from HomogeneousAggregate S

- min: % -> S if S has OrderedSet
from HomogeneousAggregate S

- more?: (%, NonNegativeInteger) -> Boolean
from Aggregate

- parts: % -> List S
from HomogeneousAggregate S

- reduce: ((S, S) -> S, %) -> S
from Collection S

- reduce: ((S, S) -> S, %, S) -> S
from Collection S

- reduce: ((S, S) -> S, %, S, S) -> S if S has BasicType
from Collection S

- remove: (S -> Boolean, %) -> %
from Collection S

- remove: (S, %) -> % if S has BasicType
from Collection S

- removeDuplicates: % -> % if S has BasicType
from Collection S

- rotate!: % -> %
`rotate!(q)`

rotates queue`q`

so that the element at the front of the queue goes to the back of the queue. Note: rotate!(`q`

) is equivalent to enqueue!(dequeue!(`q`

)).

- select: (S -> Boolean, %) -> %
from Collection S

- size?: (%, NonNegativeInteger) -> Boolean
from Aggregate

CoercibleTo OutputForm if S has CoercibleTo OutputForm

ConvertibleTo InputForm if S has ConvertibleTo InputForm

Evalable S if S has SetCategory and S has Evalable S

InnerEvalable(S, S) if S has SetCategory and S has Evalable S

SetCategory if S has SetCategory