> 
0. Any anonymous verb directly created by adverb will have the locale the same 
as the adverb.
1. Ditto for conjunction.
2. Any train of verbs will have the implied locale where they are created.


This is a change I could live with but still strongly dislike.  I will repeat 
the loc and locs definitions which help a lot.

Basically a "semi-tacit" modifier has the control to set the locales of its 
return value.  semi-tacit modifiers execute within their own locale, and so 
have the complete control over the localization of names.  In the case of 
running the resulting expression in the caller's locale, it doesn't need to do 
anything.  I won't repost inl, but that is also a tool that solves all issues 
in this thread.


loc_z_ =: (,&'_'@[ ,&'_'@, ":@>@])"1 0 boxopen
locs_z_ =: 1 : 'm loc 18!:5 '''''


adv_far_ =: 1 : 'u@(''a'' locs~) '  NB. will localize to an instance of far too.

a_far_ =: +

  3 +: adv_far_ 2
10

  +: adv_far_ 
+:@a_far_

explicit version does not work.  It produces an expression that will be parsed 
in caller's locale... an expression that can be saved to a name in any locale.  
Would be a very big change to change 1 : behaviour.


advE_far_ =: 1 : 'u@(''a'' locs~) y'
     +: advE_far_ 
+: (1 : 'u@(''a'' locs~) y')

If a change is pursued, instead of changling 1 : , and 2 :, create 5 : and 6 :

where 5 : is identical to 1 :, except that if it is executed from a name then 
that execution occurs in that name's locale.  Similar for 6 :


________________________________
From: Xiao-Yong Jin <jinxiaoy...@gmail.com>
To: "programm...@jsoftware.com" <programm...@jsoftware.com> 
Sent: Thursday, April 6, 2017 11:17 AM
Subject: Re: [Jprogramming] locales with adverbs and conjunctions?




> On Apr 4, 2017, at 7:11 PM, Henry Rich <henryhr...@gmail.com> wrote:
> 
> I have been thinking about this & I don't see a better solution than Raul's.  
> @Raul: think about putting something in NuVoc explaining this.
> 
> I thought at first: should the anonymous verb created by
> 
> verb adv_locale_
> 
> automatically be executed in (locale)?  That would solve the immediate 
> problem.
> 
> But it leaves us with the responsibility of defining a locale for every 
> anonymous verb.  What locale should we assign to:
> 
> (V0 V1_locale_ V2)
> 
> (V0_locale0_ V1_locale1_ V2_locale2_)
> 
> (V0_locale0_ V1)
> 
> ?

I failed to see what is the problem here with giving a locale for every 
anonymous verb.
What about this rule?
0. Any anonymous verb directly created by adverb will have the locale the same 
as the adverb.
1. Ditto for conjunction.
2. Any train of verbs will have the implied locale where they are created.

So, given
   cocurrent'l0'
The anonymous verb,
   (v0 v1_l1_) adv_la_ conj_lc_ (v2_l2_ v3_l3_)
as a whole will have a locale lc,
while the part '(v0 v1_l1_) adv_la_' have the locale la,
the part 'v0 v1_l1_' have the locale l0,
and the part 'v2_l2_ v3_l3_' have the locale l0 (though it does nothing since 
v2 and v3 have their locale set).

At least this was what I thought before discovering that adverb and conjunction 
do different things in the current implementation.



----------------------------------------------------------------------
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