How about:  qualify name in the calling locale?

In other words, if calling locale is FOO

abc becomes abc_FOO_
abc_xyz_ remains abc_xyz_
abc__Y with Y_FOO_ being X becomes abc_X_

This covers most of the important issues I can think of...

The remaining issue (getting the calling locale an identifier) can be
achieved by passing an empty string instead of a name.

 Thanks,

-- 
Raul


On Wed, Apr 5, 2017 at 3:49 PM, 'Pascal Jasmin' via Programming
<programm...@jsoftware.com> wrote:
> well, 18!:51 proposal,
>
> Returns name of the caller's locale (the locale that execution will return to 
> after execution of the current function).
>
>
> But, using it would be awkward compared to passing qualified names to begin 
> with.  This can already be done generically with:
>
> loc =: (,&'_'@[ ,&'_'@, ":@>@])"1 0 boxopen
> locs_z_ =: 1 : 'm loc 18!:5 '''''
>
>  'a' locs
> a_base_
>
> but I think the use case Raul is thinking of is that if the user/caller did 
> not provide a localized version of the name, the adverb/function that knows 
> its a name, could localize it for them.  That would certainly be convenient.  
> For example,
>
> myadv_far_ =: locs (1 : 'u~ y')  NB. cannot include locs (relevant/relative 
> to caller) as part of localized definition.
>
>
>     'a' myadv_far_
> 'a_far_' (1 : 'u~ y')
>
>
> ________________________________
> From: Henry Rich <henryhr...@gmail.com>
> To: programm...@jsoftware.com
> Sent: Wednesday, April 5, 2017 3:08 PM
> Subject: Re: [Jprogramming] locales with adverbs and conjunctions?
>
>
>
> Oooh, let's talk about this.
>
> What would you like to see?
>
> I have long wanted to be able to evaluate a name in the context of the
> caller of an adv/conj, so that I can pass a private name into a
> conjunction and have it evaluated there.
>
> If we can come up with a sound proposal, it can be implemented.
>
> Henry Rich
>
>
> On 4/5/2017 1:31 PM, Raul Miller wrote:
>> The inability of determining the locale of the calling context (to
>> qualify non-locative names with it) has bothered me for some time
>> (many years).
>>
>> However, I did not have a convincing use case where it was significant
>> (I was trying to work with trace, and that apparently was not
>> important enough to warrant addressing this issue).
>>
>> I think something should be done about it, but I'll leave the details
>> of that to the ISI folks.
>>
>> Thanks,
>>
>
> ----------------------------------------------------------------------
> 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