Oh, right, I remember now.

Evaluation of an adverb is a separate step from evaluation of a verb:

   require'trace'
   trace '] 1 :''u y'' 0'
 --------------- 4 Conj -------
 1
  :
 'u y'
 1 : 'u y'
 --------------- 3 Adverb -----
 ]
 1 : 'u y'
 ] (1 : 'u y')
 --------------- 0 Monad ------
 ] (1 : 'u y')
 0
 0
 ==============================
0

Thanks - I had forgotten that.

-- 
Raul

On Fri, Mar 31, 2017 at 9:40 AM, 'Pascal Jasmin' via Programming
<programm...@jsoftware.com> wrote:
> "The rule" is that "Semi tacit" modifiers can implicitly access members of 
> their own locale.  Explicit modifiers cannot.  The reason why.
>
>  +: 1 : 'u'  NB. semi tacit: processes entirely in locale and returns tacit 
> expression (then vanishes)
>
> +:
>
>   +: 1 : ' u y' NB. explicit. returns bound explicit expression that executes 
> in some unknown locale.
> +: (1 : ' u y')
>
>
> You can also explicitly label the locales used in an explicit modifier.
>
> 1 : ' u aa_t_ y'
>
> will work from any locale.  Though may not be appropriate when you make 
> "object instances" and need to have the reference move with the instance.
>
>
>
>
> ________________________________
> From: roger stokes <rogerstokes...@gmail.com>
> To: programm...@jsoftware.com
> Sent: Friday, March 31, 2017 4:37 AM
> Subject: Re: [Jprogramming] locales with adverbs and conjunctions?
>
>
>
> If you want  +: a_t_ 3  to give a result of 6 then you need to write:
>
>    a_t_ =: 1 : 'u aa'
>    aa_t_ =: 1 : 'u'
>
>    +: a_t_ 3
> 6
>
>
> On Fri, Mar 31, 2017 at 5:08 AM, Xiao-Yong Jin <jinxiaoy...@gmail.com>
> wrote:
>
>> Does locale change only happens with verbs?
>>
>>    v_t_=:3 :'vv y'
>>    vv_t_=:3 :'+: y'
>>    v_t_ 3
>> 6
>>    a_t_=:1 :'u aa y'
>>    aa_t_=:1 :'u y'
>>    +: a_t_ 3
>> |value error: aa
>> |   u     aa y
>>    c_t_=:2 :'u cc v y'
>>    cc_t_=:2 :'u v y'
>>    +: c_t_ *: 3
>> |value error: cc
>> |   u     cc v y
>>
>> This seems to be very inconvenient.
>> ----------------------------------------------------------------------
>> 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
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to