Help / Release / J 6.01 / : Explicit Names Changed

From J Wiki
Jump to navigation Jump to search


>> << Pri JfC LJ Phr Dic Voc !: Rel NuVoc wd Help Release



Explicit Names Changed

initial writing: 2006-01-26
last updated: 2006-02-13


In an explicit definition, a name assigned by the copula =. is made local. A name assigned by =: is global, except that global assignment to a local name is not permitted. Locative assignment (using either =: or =.) is always global.

The arguments in an explicit definition have been changed to x y u v m n from x. y. u. v. m. n. . For example:

   pow=: 4 : '*/ *:^:(I.|.#:y) x' " 0

   3x pow 12 50
531441 717897987691852588770249

For compatibility, use of x. etc. will be permitted, and existing explicit definitions will continue to work except if they use x etc. as global names. The effects for a dyadic verb are as follows:

J 5.04         J 6.01
foo=: 4 : 0

 x.=. (left   argument)
 y.=. (right argument)
 (rest of verb)

)
  foo=: 4 : 0

 x=. x.=. (left   argument)
 y=. y.=. (right argument)
 (rest of verb)

)

The Explicit Argument Names flag is a temporary facility that controls whether the names x. y. u. v. m. n. are permitted. 9!:48 queries the flag; 9!:49 sets it.



>> << Pri JfC LJ Phr Dic Voc !: Rel NuVoc wd Help Release