aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/array1.spad.pamphlet
diff options
context:
space:
mode:
Diffstat (limited to 'src/algebra/array1.spad.pamphlet')
-rw-r--r--src/algebra/array1.spad.pamphlet2
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)