Modified Assignment

From NARS2000
Revision as of 14:03, 12 August 2019 by WikiSysop (talk | contribs) (WikiSysop moved page Modify Assignment to Modified Assignment without leaving a redirect)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
Af←R is shorthand for A←A R.   Modified Assignment
A[I]f←R is shorthand for A[I]←A[I] R   Modified Indexed Assignment
A is a name with an existing value, I is an arbitrary index to A, f is an arbitrary dyadic function, and R is an arbitrary array.


For example, A+←1 is shorthand for A←A+1, and A,←' ' is shorthand for A←A,' '.

      a←⍳¨⍳4
      a
 1  1 2  1 2 3  1 2 3 4 
      a[3 4]⍴←a[3 4]
      a
 1  1 2    1 2 3     1 2 3 4 
           1 2 3     1 2 3 4 
                     1 2 3 4 
                             
                     1 2 3 4 
                     1 2 3 4 
                     1 2 3 4