I think the issue is
http://www.jsoftware.com/help/dictionary/dicti.htm which says:

     Every global name is executed in the current locale. Initially,
the current locale is base. A locative f_abc_, while it is executing,
switches the current locale to abc.

This leaves two important issues unspecified:

[1] What happens when local names get executed?
[2] When does locale switch for non-locatives?

By inspection we can see that locale is a local property of a named
verb (which is different from =. values, which are local properties of
explicit procedure -- and we can have unnamed explicit procedures and
named tacit procedures -- alternatively we can have zero or more
explicit procedures in a named procedure).  [And note that I am using
"procedure" to denote verb/adverb/conjunction -- it's anything that
can be named that is not a noun.]

Also, by inspection, we can see that locale is an implicit parameter
to any named procedure (or an explicit parameter in the context of
locatives).

Anyways, point [1] could be addressed by eliminating "global" from
that description.  And brief testing seems to suggest that the
description would still be accurate with this change:

test=:3 :0
   a=.3 :'cocurrent ''alternate'''
   b=. a@0:
   b ''
   >coname''
)
   test''
base

This change eliminates the suggestion that some names do not have
current locales which I think would be a good thing.  But this change
introduces a potential conflict, for some people, with the sentence
describing locatives, which would be a bad thing.

But also, there is a chicken and egg problem here:  to describe what a
locale does you have to know what it is and for the description of
what it is to be meaningful you have to describe what it does.

A solution to this dilemma, I think, would be start out passively, and
then go on to describe how that is used:

"Each execution of a name has a current locale, which is used to
resolve global names.  A locative such as f_abc_ uses the locale abc
for its current locale."

This also saves 14 characters so has a minor brevity advantage.

-- 
Raul


On Mon, May 30, 2011 at 6:29 PM, bill lam <[email protected]> wrote:
> Where is this documented?
>
> Пнд, 30 Май 2011, Henry Rich писал(а):
>> locale is reset when a named verb completes.  So you just need a proverb
>> for 0!:0 .
>>
>> Henry Rich
>>
>> On 5/30/2011 5:27 PM, Raul Miller wrote:
>> > Well.. here is my workaround for the problem with )
>> >
>> > require'strings'
>> > 0!:0 rplc&(').';')')0 :0
>> >
>> > )
>> >
>> > That's a bit verbos, but with it I can use ). within the script.
>> >
>> > But that still does not deal with the issue of the locale when 0!:0 
>> > finishes.
>> >
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>
> --
> regards,
> ====================================================
> GPG key 1024D/4434BAB3 2008-08-24
> gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
> ----------------------------------------------------------------------
> 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