Explicitly including the locale in a name makes a local copula (=.) a global
assignment. I have used this on occasion where I want some names in a
multiple assignment to be local and others global. It also lets you get
around the error message about making an assignment of a global name when
the name already exists as a local name.

2010/1/18 Björn Helgason <[email protected]>

> It is an interesting fact that when you use locale and even if you
> define it a local it works as global.
>
> I often use this instead of global in the base locale.
>
> By using locales the nouns and names are also better isolated.
>
> Example:
>
>   f=: 3 : 0
> TEST_test_=.y
> )
>
>
>   TEST_test_
> |value error: TEST_test_
> |[-5]
>
>   f 55
> 55
>
>   TEST_test_
> 55
>
>   f 1  1  2 2 55
> 1 1 2 2 55
>
>   TEST_test_
> 1 1 2 2 55
>
>
>
> --
> Björn Helgason, Verkfræðingur
> Fornustekkum II
> 781 Hornafirði
> Po Box 127,801 Selfoss ,
> t-póst: [email protected]
> gsm: +3546985532
> sími: +3544781286
> http://groups.google.com/group/J-Programming
>
>
> Tæknikunnátta höndlar hið flókna, sköpunargáfa er meistari einfaldleikans
>
> góður kennari getur stigið á tær án þess að glansinn fari af skónum
>          /|_      .-----------------------------------.
>         ,'  .\  /  | Með léttri lund verður        |
>     ,--'    _,'   | Dagurinn í dag                     |
>    /       /       | Enn betri en gærdagurinn  |
>   (   -.  |        `-----------------------------------'
>   |     ) |         (\_ _/)
>  (`-.  '--.)       (='.'=)   ♖♘♗♕♔♙
>   `. )----'        (")_(") ☃☠
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to