From 003f78cdb3e973631cc141814a89b92275988aaf Mon Sep 17 00:00:00 2001 From: dos-reis Date: Sat, 18 May 2013 02:11:08 +0000 Subject: * algebra/attreg.spad.pamphlet (AttributeRegistry): Remove shallowlyMutble. * algebra/aggcat.spad.pamphlet (BagAggregate): Extend ShallowlyMutableAggregate. (ExtensibleLinearAggregate): Likewise. * algebra/mset.spad.pamphlet (Multiset): Likewise. * algebra/tree.spad.pamphlet (Tree): Likewise. --- src/algebra/aggcat.spad.pamphlet | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/algebra/aggcat.spad.pamphlet') diff --git a/src/algebra/aggcat.spad.pamphlet b/src/algebra/aggcat.spad.pamphlet index baa4a420..77a0b829 100644 --- a/src/algebra/aggcat.spad.pamphlet +++ b/src/algebra/aggcat.spad.pamphlet @@ -338,9 +338,7 @@ import List ++ and where the order in which objects are inserted determines the order ++ of extraction. ++ Examples of bags are stacks, queues, and dequeues. -BagAggregate(S:Type): Category == HomogeneousAggregate S with - shallowlyMutable - ++ shallowlyMutable means that elements of bags may be destructively changed. +BagAggregate(S:Type): Category == ShallowlyMutableAggregate S with bag: List S -> % ++ bag([x,y,...,z]) creates a bag with elements x,y,...,z. extract!: % -> S @@ -2052,7 +2050,7 @@ import FiniteLinearAggregate ++ Insertion and deletion however is generally slow since an entirely new ++ data structure must be created for the result. OneDimensionalArrayAggregate(S:Type): Category == - FiniteLinearAggregate S with shallowlyMutable + Join(FiniteLinearAggregate S,ShallowlyMutableAggregate S) add parts x == [qelt(x, i) for i in minIndex x .. maxIndex x] sort!(f, a) == quickSort(f, a)$FiniteLinearAggregateSort(S, %) @@ -2318,8 +2316,7 @@ import Integer ++ concatenation efficient. However, access to elements of these ++ extensible aggregates is generally slow since access is made from the end. ++ See \spadtype{FlexibleArray} for an exception. -ExtensibleLinearAggregate(S:Type):Category == LinearAggregate S with - shallowlyMutable +ExtensibleLinearAggregate(S:Type):Category == Join(LinearAggregate S,ShallowlyMutableAggregate S) with concat!: (%,S) -> % ++ concat!(u,x) destructively adds element x to the end of u. concat!: (%,%) -> % -- cgit v1.2.3