Modify Strand Assignment: Difference between revisions
From NARS2000
Jump to navigationJump to search
Sudleyplace (talk | contribs) No edit summary |
Sudleyplace (talk | contribs) No edit summary |
||
| Line 33: | Line 33: | ||
</table> | </table> | ||
<br /> | <br /> | ||
< | <p>For example, <apll>(A B C)⍴←⊂⍳3</apll> is shorthand for <apll>A←A⍴⍳3 ⋄ B←B⍴⍳3 ⋄ C←C⍴⍳3</apll>. In contrast, <apll>(A B C)⍴←⍳3</apll> is shorthand for <apll>A←A⍴1 ⋄ B←B⍴2 ⋄ C←C⍴3</apll>.</p> | ||
For example, <apll>(A B C)⍴←⊂⍳3</apll> is shorthand for <apll>A←A⍴⍳3 ⋄ B←B⍴⍳3 ⋄ C←C⍴⍳3</apll>. In contrast, <apll>(A B C)⍴←⍳3</apll> is shorthand for <apll>A←A⍴1 ⋄ B←B⍴2 ⋄ C←C⍴3</apll>. | |||
Revision as of 11:27, 10 April 2008
|
||||
| A1 A2 ... An are all names with existing values, f is an arbitrary dyadic function, and 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←Aif ⊃⍬⍴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←Aif 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.