Ralf Hemmecke wrote:
>
> On 11/18/2013 04:37 AM, Waldek Hebisch wrote:
>
> > Attached is a patch implementing missing functions.
>
> I'm not completely satisfied. The reason lies here:
>
> ++ A dequeue is a doubly ended stack, that is, a bag where first items
> ++ inserted are the first items e
On 11/18/2013 04:37 AM, Waldek Hebisch wrote:
> Clearly the code is messed up. There are already destructive
> versions, namely 'extractTop!' and 'extractBottom!'. And there
> is nondestructive 'top'. So we should remove 'top!' and
> rename 'bottom!' to 'bottom'.
Right.
> Well, actually just r
>
> Oh... We have...
>
> DequeueAggregate(S : Type):
> Category == Join(StackAggregate S, QueueAggregate S) with
>dequeue : () -> %
> ++ dequeue()$D creates an empty dequeue of type D.
>dequeue : List S -> %
> ++ dequeue([x, y, ..., z]) creates a dequeue with first (top or fron
Oh... We have...
DequeueAggregate(S : Type):
Category == Join(StackAggregate S, QueueAggregate S) with
dequeue : () -> %
++ dequeue()$D creates an empty dequeue of type D.
dequeue : List S -> %
++ dequeue([x, y, ..., z]) creates a dequeue with first (top or front)
++ element
(1) -> a:Dequeue INT:= dequeue [1,2,3,4,5]
(1) [1,2,3,4,5]
Type:
Dequeue(Integer)
(2) -> depth a
Internal Error
The function depth with signature hashcode is missing from domain
Dequeue(Integer)
(2) -> top! a
Internal Error