diff options
author | dos-reis <gdr@axiomatics.org> | 2007-10-18 14:02:33 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2007-10-18 14:02:33 +0000 |
commit | d6ea92cf052ca5a8a8a88add347aefe78cb3303b (patch) | |
tree | 1c921fd6ad4a9e229742f4150eaf1c32bf74944a /src/algebra/array1.spad.pamphlet | |
parent | 3c643ccfe92e3fc3282a4701f70ce76b1199880e (diff) | |
download | open-axiom-d6ea92cf052ca5a8a8a88add347aefe78cb3303b.tar.gz |
Fix SF/1795259
* aggcat.spad.pamphlet (HomogeneousAggregate): Make
CoercibleTo(OutputForm) if argument is of that category.
(BinaryRecursiveAggregate): Weaken condition for coercion to
OutputForm.
(OneDimensionalArrayAggregate): Likewise.
(Tuple): Likewise.
(IndexedList): Likewise.
* tree.spad.pamphlet: Likewise.
Diffstat (limited to 'src/algebra/array1.spad.pamphlet')
-rw-r--r-- | src/algebra/array1.spad.pamphlet | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/algebra/array1.spad.pamphlet b/src/algebra/array1.spad.pamphlet index 0812a849..9b05dab0 100644 --- a/src/algebra/array1.spad.pamphlet +++ b/src/algebra/array1.spad.pamphlet @@ -138,6 +138,7 @@ Tuple(S:Type): CoercibleTo(PrimitiveArray S) with ++ tuples are 0-based length: % -> NonNegativeInteger ++ length(x) returns the number of elements in tuple x + if S has CoercibleTo(OutputForm) then CoercibleTo(OutputForm) if S has SetCategory then SetCategory == add Rep := Record(len : NonNegativeInteger, elts : PrimitiveArray S) @@ -152,6 +153,7 @@ Tuple(S:Type): CoercibleTo(PrimitiveArray S) with if S has SetCategory then x = y == (x.len = y.len) and (x.elts =$PrimitiveArray(S) y.elts) + if S has CoercibleTo(OutputForm) then coerce(x : %): OutputForm == paren [(x.elts.i)::OutputForm for i in minIndex x.elts .. maxIndex x.elts]$List(OutputForm) |