Differences between revisions 2 and 3
Revision 2 as of 2009-04-07 16:19:18
Size: 1603
Editor: SimonMarsden
Comment:
Revision 3 as of 2009-08-21 13:08:49
Size: 1668
Editor: KaiJaeger
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
#acl AutoAdminGroup:read,write,admin,delete,revert All:read

Multiple Specification

It is possible to make multiple simultaneous assignments by enclosing a list of variable names in parentheses on the left of an assignment arrow.

             (A B C)← 1 2 3
             A
       1
             B
       2
             C
       3

A scalar to the right of the assignment arrow will be assigned to every item on the left. This is known as scalar extension.

             (A B C)←5
             A
       5
             B
       5
             C
       5
             (A B C)← 'HI' 'THERE' 'FOLKS'
             ⍴A                      (A assigned 'HI' and so on)
       2
             (A B C)←⊂'HI' 'THERE' 'FOLKS'
             ⍴A                      (A, B and C assigned the enclosed vector
       3                              to the right of the assignment arrow)

<!> Caution: Do not omit the parentheses if you are trying to do multiple specification, as in:

             A B C←5

This expression will assign the value 5 to C and then attempt to evaluate the resultant expression. See also the discussion of binding strengths.


CategoryAboutApl - CategoryAplx

LearnMoreApl/MultipleSpecification (last edited 2017-02-16 18:49:52 by KaiJaeger)