diff options
author | dos-reis <gdr@axiomatics.org> | 2010-07-26 16:33:38 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2010-07-26 16:33:38 +0000 |
commit | d05164b7bc0d0998e9e220497386ff7d7cc9a445 (patch) | |
tree | d2aac85e74b965f3fef32d1394aef5d4762901fd /src/algebra/array1.spad.pamphlet | |
parent | 2676acdd33957fe60f54ff9ec73fac8b7a6ed705 (diff) | |
download | open-axiom-d05164b7bc0d0998e9e220497386ff7d7cc9a445.tar.gz |
* interp/g-opt.boot ($VMsideEffectFreeOperators): Include new
opcodes %icst0, %icst1, %when, and %ccst.
* interp/g-util.boot: Expand %ccst.
* algebra/alql.spad.pamphlet: Clean up.
* algebra/array1.spad.pamphlet: Likewise.
* algebra/c02.spad.pamphlet: Likewise.
* algebra/d03.spad.pamphlet: Likewise.
* algebra/e04.spad.pamphlet: Likewise.
* algebra/integer.spad.pamphlet: Likewise.
* algebra/si.spad.pamphlet: Likewise.
* algebra/string.spad.pamphlet: Likewise.
Diffstat (limited to 'src/algebra/array1.spad.pamphlet')
-rw-r--r-- | src/algebra/array1.spad.pamphlet | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/algebra/array1.spad.pamphlet b/src/algebra/array1.spad.pamphlet index 0d4257e8..7eb4c367 100644 --- a/src/algebra/array1.spad.pamphlet +++ b/src/algebra/array1.spad.pamphlet @@ -15,8 +15,10 @@ ++ This provides a fast array type with no bound checking on elt's. ++ Minimum index is 0 in this type, cannot be changed PrimitiveArray(S:Type): OneDimensionalArrayAggregate S == add + macro NNI == NonNegativeInteger import %vlength: % -> NonNegativeInteger from Foreign Builtin import %vref: (%,Integer) -> S from Foreign Builtin + import makeSimpleArray: (Domain,NNI) -> % from Foreign Builtin #x == %vlength x @@ -24,7 +26,7 @@ PrimitiveArray(S:Type): OneDimensionalArrayAggregate S == add 0 empty() == - makeSimpleArray(getVMType(S)$Lisp,0$Lisp)$Lisp + makeSimpleArray(getVMType(S)$Lisp,0) construct l == makeSimpleArrayFromList(getVMType(S)$Foreign(Builtin),l)$Foreign(Builtin) @@ -429,12 +431,12 @@ IndexedOneDimensionalArray(S:Type, mn:Integer): qsetelt!(x, i, s) == Qsetelt(x, i-1, s) elt(x:%, i:I) == - QSLESSP(i,1$Lisp)$Lisp or QSLESSP(%vlength x,i)$Lisp => + QSLESSP(i,1@I)$Lisp or QSLESSP(%vlength x,i)$Lisp => error "index out of range" %vref(x, i-1) setelt(x:%, i:I, s:S) == - QSLESSP(i,1$Lisp)$Lisp or QSLESSP(%vlength x,i)$Lisp => + QSLESSP(i,1@I)$Lisp or QSLESSP(%vlength x,i)$Lisp => error "index out of range" Qsetelt(x, i-1, s) |