diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2014-08-21 20:33:29 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2014-08-21 20:35:52 -0700 |
commit | 6a2edbe8cad4547921fa6d7307af47b5190a2b48 (patch) | |
tree | 8189cfb81f5d48b71082d102265e3c5909d27036 /mu.arc | |
parent | 6f9bf3a063470d02cfaff0601281e39ee315e6a3 (diff) | |
download | mu-6a2edbe8cad4547921fa6d7307af47b5190a2b48.tar.gz |
65 - separate op for array indexing
'get' no longer supports that case; that was confusing.
Diffstat (limited to 'mu.arc')
-rw-r--r-- | mu.arc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mu.arc b/mu.arc index 789b30f3..04a6af69 100644 --- a/mu.arc +++ b/mu.arc @@ -167,14 +167,15 @@ idx (v arg.1)) ; literal integer (if typeinfo.base!array ; array is an integer 'sz' followed by sz elems - (if (is 0 idx) - (m `(,v.base integer)) - (array-ref base (- idx 1))) + ; 'get' can only lookup its index + (m `(,v.base integer)) ; field index (m `(,(+ v.base (apply + (map sz (firstn idx typeinfo.base!elems)))) ,typeinfo.base!elems.idx)))) + aref + (array-ref arg.0 (v arg.1)) reply (do (= result arg) (break)) |