Copula =. Local =: Global

copula is used to assign a referent to a name, as in a=:3 and in sum=:+/ . copula =. is local as discussed under 明確 定義(:), and =: is global. Copulas may also be used indirectly, with name or names specified as a character list or a boxed list; moreover, if character list begins with ` n 動名詞 referents are evoked.
 

例如:
   f=: 3 : 0
a=. +:y.
b=: *:a
10*b
)

   a=: b=: 678
   a,b
678 678

   f 3 
360

   a,b 
678 36

   x=: 'abc';'c'
   (x) =: 3 4 ; 5 6 7
   abc
3 4
   c
5 6 7
Note that parenses around name x force it to be evaluated before assignment specified by copula is effected.
   'alpha beta'=: i.2 4
   alpha
0 1 2 3

   beta 
4 5 6 7

   '`sum sqrt'=: +/ ` %:
   sum 3 1 4 2
10
   sqrt 2
1.41421

下個前個字彙索引主選單