Indexing

From NARS2000
Revision as of 15:10, 13 April 2008 by Sudleyplace (talk | contribs) (New page: <table border="1" cellpadding="5" cellspacing="0" rules="none" summary=""> <tr> <td> <table border="0" cellpadding="5" cellspacing="0" summary=""> <tr> <td><apll>Z←R[L]</...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
Z←R[L], R[L]←A, and R[L]f←A</apll> are all extended to allow both Reach and Scatter indexing.
L is a nested array of integer scalars and/or vectors, suitable for indexing R.
R is an arbitrary array.
A is an arbitrary array.
If L⊃R is valid, it is equivalent to ⊃R[⊂L], and if L⌷R is valid, it is equivalent to R[⊃∘.,/L] — Reach and Scatter indexing may appear together within a single instance of R[L], R[L]←A, and R[L]f←A


For example, in origin-1



  • Index reference, assignment, modify assignment, squad, and pick (R[L], R[L]←A, R[L]f←A, L⌷R, and L⊃R) are each extended to negative index values. That is, if the largest allowed index value is N, then the previous allowable range of values was ⎕IO to N, inclusive. Now, the allowable range of values is 1 ¯1[1]-N to N, inclusive. For example, A, A[⍳⍴A], and A[⍳-⍴A] are all identical for any array A in either origin.