Modify Strand Assignment

From NARS2000
Revision as of 14:17, 9 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><apl size="large...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
(A1 A2 ... An)fn←R In general, assigns Ai←Aifn i⊃R.
A1 A2 ... An are all names with existing values, R is a scalar or vector.
If 1<⍴⍴R, signal a RANK ERROR.
If R is a scalar or one element vector, its item, in combination with the value of each name, is assigned to each name, as in Ai←Aifn ⊃⍬⍴R.
Otherwise, assume there are n names in the list:
If n≠⍴R, signal a LENGTH ERROR.
Otherwise, each successive item of R, in combination with the value of each successive name, is assigned to each successive name, as in Ai←Aifn i⊃R.



For example, (A B C)⍴←⊂⍳3 is shorthand for A←A⍴⍳3 ⋄ B←B⍴⍳3 ⋄ C←C⍴⍳3. In contrast, (A B C)⍴←⍳3 is shorthand for A←A⍴1 ⋄ B←B⍴2 ⋄ C←C⍴3. Also, (A B C),←(1 2) 'abc' 1.1 is shorthand for A←A,1 2 ⋄ B←B,'abc' ⋄ C←C,1.1.