I know of no documentation for this. But after further testing, what I
find is consistent with the following:
When a named entity finishes, it normally restores the current locale to
what it was when it started. However, there is a flag (call it
NORESTORE) that suppresses this. When NORESTORE is set, the current
locale is not reset when the named entity finishes.
NORESTORE is set by 18!:4 and cleared when a named entity finishes.
Execution of 18!:4 immediately changes the current locale.
Again, this is just a guess at what the implementation might be, but it
is simple and fast and consistent with the results I see, so maybe it's
close to right.
Henry Rich
david alis wrote:
> Henry,
> It is the difference in behaviour between 'foof' and 'goof' that's confusing.
> Both of them use 18!:4 directly:
>> goof =: 3 : ('cocurrent f.''GOO''';'1+2';'empty 3')
>> NB. resets the locale to base (this result is unexpected)
>
>> foof =: 3 : ('cocurrent f.''FOO''';'1+2')
>> NB. leaves the locale set to FOO
>
> Where can I find material that describes how locales behave?
>
> Searching on 'locale' on the jsoftware website doesnt return much
> that's helpful.
> And the primer doesn't go into much depth regarding locale paths.
> http://www.jsoftware.com/jwiki/Essays?action=fullsearch&context=180&value=locale&titlesearch=Titles
>
> fyi - it was studying Oleg's 'sax.ijs' script that got me onto this track.
> It contains:
> saxclass_z_=: cocurrent@(3 : 0) f.
> coclass y
> coinsert 'psax'
> process=: process_psax_ f.
> y
> )
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm