From d6ea92cf052ca5a8a8a88add347aefe78cb3303b Mon Sep 17 00:00:00 2001 From: dos-reis Date: Thu, 18 Oct 2007 14:02:33 +0000 Subject: 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. --- src/algebra/array1.spad.pamphlet | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/algebra/array1.spad.pamphlet') 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) -- cgit v1.2.3