Yes, locale references are boxed literals. If they are generated by J, the literal is rank 1, but for convenience you can use a rank 0 literal when the name is a single character.
References include: http://www.jsoftware.com/help/dictionary/intro17.htm http://www.jsoftware.com/help/dictionary/dicti.htm http://www.jsoftware.com/help/dictionary/dx018.htm The page describing locatives (dicti.htm) mentions the equivalence between a trailing _base_ and a trailing __ I hope this helps, -- Raul On Tue, Jan 15, 2013 at 11:03 AM, Steven Taylor <[email protected]> wrote: > So NAME contains a boxed literal? Thanks for the warning on numbered > locales. > > Just as a quick test to see if I understand: > > (18!:3) <'testns' > ┌──────┐ > │testns│ > └──────┘ > T=:<'testns' > T > ┌──────┐ > │testns│ > └──────┘ > x__T=:1 2 3 > x__T > 1 2 3 > > > I found a reference to the __ notation in J for C. Is it mentioned > elsewhere too? > > I'll take a look at OO in J again now that I understand this. > > thanks, > -Steven > > > On 15 January 2013 14:55, Raul Miller <[email protected]> wrote: > >> On Tue, Jan 15, 2013 at 9:10 AM, Steven Taylor <[email protected]> wrote: >> > Now is it possible to define a locale as being available everywhere in >> the >> > same way that _z_ is? _z_ seems to be quite full of things already. >> >> You can add your locale to the paths of all existing locales, and you >> can change cocreate to include your path in new locales, but having >> newly created locales (for example, 18!:3 results) reference your >> locale would require a change to the interpreter. >> >> > Can we define an alias to a locale? >> >> That's what the x__NAME notation does >> >> NAME=: 18!:3 '' >> x__NAME=: i. 3 3 >> >> Here, NAME is an alias for some arbitrary locale. >> >> In other words, you do not know if you were referencing x_3_ or x_8_ >> or some other locale without some additional knowledge (you can >> inspect NAME or in some cases you can predict NAME, since it was >> created based on a counter). >> >> > A few notes on locales: >> > >> > __ is a shortcut to _base_ >> >> deprecated, I think, but yes. >> >> > _z_ is available everywhere >> >> Yes. >> >> Interestingly enough, we can remove z from a locale's path and still >> have access to the names defined in z. This might be a bug. >> >> -- >> Raul >> ---------------------------------------------------------------------- >> For information about J forums see http://www.jsoftware.com/forums.htm >> > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
