aboutsummaryrefslogtreecommitdiff
path: root/src/algebra
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2013-05-13 05:10:19 +0000
committerdos-reis <gdr@axiomatics.org>2013-05-13 05:10:19 +0000
commit79e0bdea715eea9bbbe308777a1a7a8b1d8c72f4 (patch)
treede2a221c52595d917d2f55824f1b8da8b98a05c3 /src/algebra
parent6c8119a8b2cc0b039dced28cf6cc1c6df45c59f7 (diff)
downloadopen-axiom-79e0bdea715eea9bbbe308777a1a7a8b1d8c72f4.tar.gz
* interp/g-opt.boot (%array2list): New side-effect free opcode.
* interp/lisp-backend.boot: Expand it. * algebra/array1.spad.pamphlet (PrimitiveArray): Implement maxIndex, parts, and members.
Diffstat (limited to 'src/algebra')
-rw-r--r--src/algebra/array1.spad.pamphlet5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/algebra/array1.spad.pamphlet b/src/algebra/array1.spad.pamphlet
index 9ace920a..ee4b913b 100644
--- a/src/algebra/array1.spad.pamphlet
+++ b/src/algebra/array1.spad.pamphlet
@@ -17,12 +17,14 @@
PrimitiveArray(S:Type): OneDimensionalArrayAggregate S == add
macro NNI == NonNegativeInteger
import %icst0: Integer from Foreign Builtin
+ import %icst1: Integer from Foreign Builtin
import %vlength: % -> NNI from Foreign Builtin
import %vcopy: % -> % from Foreign Builtin
import %vfill: (%,S) -> % from Foreign Builtin
import %aref: (%,Integer) -> S from Foreign Builtin
import %emptyArray: Type -> % from Foreign Builtin
import %list2array: (List S,Type) -> % from Foreign Builtin
+ import %array2list: % -> List S from Foreign Builtin
import %simpleArray: (Type,NNI,S) -> % from Foreign Builtin
#x == %vlength x
@@ -36,6 +38,9 @@ PrimitiveArray(S:Type): OneDimensionalArrayAggregate S == add
setelt(x:%, i:Integer, s:S) == %store(%aref(x,i),s)$Foreign(Builtin)
fill!(x, s) == %vfill(x,s)
copy x == %vcopy x
+ maxIndex x == #x - %icst1
+ parts x == %array2list x
+ members x == parts x
@