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 4: | Line 4: | ||
<table border="0" cellpadding="5" cellspacing="0" summary=""> | <table border="0" cellpadding="5" cellspacing="0" summary=""> | ||
<tr> | <tr> | ||
<td><apl size="large"> (A<sub>1</sub> A<sub>2</sub> ... A<sub>n</sub>)<i>fn</i> | <td><apl size="large"> (A<sub>1</sub> A<sub>2</sub> ... A<sub>n</sub>)<i>fn</i>←R</apl></td> | ||
<td></td> | <td></td> | ||
<td></td> | <td></td> | ||
<td>In general, assigns <apl size="large">A<sub>i</sub> | <td>In general, assigns <apl size="large">A<sub>i</sub>←A<sub>i</sub><i>fn</i> i⊃R</apl>. </td> | ||
</tr> | </tr> | ||
</table> | </table> | ||
Line 17: | Line 17: | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>If <apl size="large">1< | <td>If <apl size="large">1<⍴⍴R</apl>, signal a <apl size="large">RANK ERROR</apl>.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>If <apl size="large">R</apl> is a scalar or one element vector, its item, in combination with the value of each name, is assigned to each name, as in <apl size="large">A<sub>i</sub>{is}A<sub>i</sub><i>fn</i> | <td>If <apl size="large">R</apl> is a scalar or one element vector, its item, in combination with the value of each name, is assigned to each name, as in <apl size="large">A<sub>i</sub>{is}A<sub>i</sub><i>fn</i> ⊃⍬⍴R</apl>.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
Line 26: | Line 26: | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>If <apl size="large"> | <td>If <apl size="large">n≠⍴R</apl>, signal a <apl size="large">LENGTH ERROR</apl>.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>Otherwise, each successive item of <apl size="large">R</apl>, in combination with the value of each successive name, is assigned to each successive name, as in <apl size="large">A<sub>i</sub> | <td>Otherwise, each successive item of <apl size="large">R</apl>, in combination with the value of each successive name, is assigned to each successive name, as in <apl size="large">A<sub>i</sub>←A<sub>i</sub><i>fn</i> i⊃R</apl>.</td> | ||
</tr> | </tr> | ||
</table> | </table> | ||
<br /> | <br /> | ||
<br /> | <br /> | ||
For example, <apl size="large">(A B C) | For example, <apl size="large">(A B C)⍴←⊂⍳3</apl> is shorthand for <apl size="large">A←A⍴⍳3 ⋄ B←B⍴⍳3 ⋄ C←C⍴⍳3</apl>. In contrast, <apl size="large">(A B C)⍴←⍳3</apl> is shorthand for <apl size="large">A←A⍴1 ⋄ B←B⍴2 ⋄ C←C⍴3</apl>. |
Revision as of 11:02, 9 April 2008
|
||||
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.