diff options
Diffstat (limited to 'src/algebra')
-rw-r--r-- | src/algebra/Makefile.am | 2 | ||||
-rw-r--r-- | src/algebra/Makefile.in | 2 | ||||
-rw-r--r-- | src/algebra/aggcat.spad.pamphlet | 14 | ||||
-rw-r--r-- | src/algebra/exposed.lsp.pamphlet | 1 | ||||
-rw-r--r-- | src/algebra/list.spad.pamphlet | 7 |
5 files changed, 13 insertions, 13 deletions
diff --git a/src/algebra/Makefile.am b/src/algebra/Makefile.am index 293fa2fb..f3ca4da6 100644 --- a/src/algebra/Makefile.am +++ b/src/algebra/Makefile.am @@ -1330,7 +1330,7 @@ oa_algebra_layer_0 = \ COMBOPC EQ2 NONE1 CONDUIT IOMODE CTORKIND \ AGG AGG- ELTAGG ELTAGG- IXAGG IXAGG- \ BGAGG BGAGG- BRAGG BRAGG- ELAGG ELAGG- \ - DLAGG DQAGG QUAGG SKAGG PRQAGG ALAGG \ + DLAGG DQAGG QUAGG SKAGG PRQAGG ALAGG ALAGG- \ FLAGG FLAGG- URAGG URAGG- LNAGG LNAGG- \ A1AGG A1AGG- LSAGG LSAGG- SRAGG SRAGG- \ FSAGG FSAGG- STAGG STAGG- CLAGG CLAGG- \ diff --git a/src/algebra/Makefile.in b/src/algebra/Makefile.in index 5b8a4c50..14d5079c 100644 --- a/src/algebra/Makefile.in +++ b/src/algebra/Makefile.in @@ -723,7 +723,7 @@ oa_algebra_layer_0 = \ COMBOPC EQ2 NONE1 CONDUIT IOMODE CTORKIND \ AGG AGG- ELTAGG ELTAGG- IXAGG IXAGG- \ BGAGG BGAGG- BRAGG BRAGG- ELAGG ELAGG- \ - DLAGG DQAGG QUAGG SKAGG PRQAGG ALAGG \ + DLAGG DQAGG QUAGG SKAGG PRQAGG ALAGG ALAGG- \ FLAGG FLAGG- URAGG URAGG- LNAGG LNAGG- \ A1AGG A1AGG- LSAGG LSAGG- SRAGG SRAGG- \ FSAGG FSAGG- STAGG STAGG- CLAGG CLAGG- \ diff --git a/src/algebra/aggcat.spad.pamphlet b/src/algebra/aggcat.spad.pamphlet index 512bf628..473cfd2c 100644 --- a/src/algebra/aggcat.spad.pamphlet +++ b/src/algebra/aggcat.spad.pamphlet @@ -190,7 +190,7 @@ FiniteAggregate(S: Type): Category == Exports where ++ that support in place mutation that do not change their general ++ shapes. ShallowlyMutableAggregate(S: Type): Category == Exports where - Exports == HomogeneousAggregate S with + Exports == Aggregate with map!: (S->S,%) -> % ++ \spad{map!(f,u)} destructively replaces each element ++ \spad{x} of \spad{u} by \spad{f(x)} @@ -275,7 +275,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 == ShallowlyMutableAggregate S with +BagAggregate(S:Type): Category == Join(HomogeneousAggregate S,ShallowlyMutableAggregate S) with bag: List S -> % ++ bag([x,y,...,z]) creates a bag with elements x,y,...,z. extract!: % -> S @@ -1095,6 +1095,7 @@ TableAggregate(Key:SetCategory, Entry:SetCategory): Category == table l == dictionary l -- empty() == dictionary() + insert!(p,t) == (t(p.key) := p.entry; t) indices t == keys t coerce(t:%):OutputForm == @@ -2546,10 +2547,11 @@ import ListAggregate ++ as a table. It is a poor mans version of a table: ++ searching for a key is a linear operation. AssociationListAggregate(Key:SetCategory,Entry:SetCategory): Category == - Join(TableAggregate(Key, Entry), ListAggregate Record(key:Key,entry:Entry)) with - assoc: (Key, %) -> Maybe Record(key:Key,entry:Entry) - ++ assoc(k,u) returns the element x in association list u stored - ++ with key k, or \spad{nothing} if u has no key k. + Join(TableAggregate(Key, Entry),ListAggregate Record(key:Key,entry:Entry),_ + ShallowlyMutableAggregate Entry) with + assoc: (Key, %) -> Maybe Record(key:Key,entry:Entry) + ++ assoc(k,u) returns the element x in association list u stored + ++ with key k, or \spad{nothing} if u has no key k. @ diff --git a/src/algebra/exposed.lsp.pamphlet b/src/algebra/exposed.lsp.pamphlet index 983557ab..c059742a 100644 --- a/src/algebra/exposed.lsp.pamphlet +++ b/src/algebra/exposed.lsp.pamphlet @@ -1097,6 +1097,7 @@ (|AlgebraicallyClosedField&| . ACF-) (|AlgebraicallyClosedFunctionSpace&| . ACFS-) (|ArcTrigonometricFunctionCategory&| . ATRIG-) + (|AssociationListAggregate&| . ALAGG-) (|BagAggregate&| . BGAGG-) (|BasicType&| . BASTYPE-) (|BinaryRecursiveAggregate&| . BRAGG-) diff --git a/src/algebra/list.spad.pamphlet b/src/algebra/list.spad.pamphlet index 2bf3a01d..82a2cc73 100644 --- a/src/algebra/list.spad.pamphlet +++ b/src/algebra/list.spad.pamphlet @@ -478,6 +478,7 @@ AssociationList(Key:SetCategory, Entry:SetCategory): Rep := Reference List Pair dictionary() == ref empty() + dictionary l == ref l empty() == dictionary() empty? t == empty? deref t entries(t:%):List(Pair) == deref t @@ -507,10 +508,6 @@ AssociationList(Key:SetCategory, Entry:SetCategory): if not empty?(l) then s := concat(s, ", ")$String concat(s, " \right]")$String --- assoc(k, l) == --- (r := find(#1.key=k, l)) case "failed" => "failed" --- r - assoc(k, t) == for r in deref t repeat k = r.key => return just r @@ -542,7 +539,7 @@ AssociationList(Key:SetCategory, Entry:SetCategory): <<license>>= --Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. --All rights reserved. --- Copyright (C) 2007-2010, Gabriel Dos Reis. +-- Copyright (C) 2007-2013, Gabriel Dos Reis. -- All rights reserved. -- --Redistribution and use in source and binary forms, with or without |