What do you do if a local name is mapped to a file?

On Thu, Dec 24, 2009 at 2:44 PM, Dan Bron <[email protected]> wrote:
> Viktor Cerovski wrote:
>>  This leads us to consider a generalization of the adverb f.,
>>  namely a conjunction f: (fix-without) such that
>>
>>    U f: 'C'
>>
>>  would fix U except for C, giving:
>>
>>    C * %
>
> I actually have a tool that does this, in a different manner.  I wrote a 
> version of  f.  that fixes only /local/ names.  That is it fixes those names 
> assigned with  =.  but not those assigned with  =:  .
>
> I think this is a fairly elegant approach, because local names by definition 
> are ephemeral, and are going to go out of scope, so therefore any (global) 
> name that depends on local (non-noun) names really wants a copy of their 
> value, not a reference to it (which reference is going to break, later).  So 
> you'd write the above like this
>
>           C =: 1 fun     NB.  Note global =:
>           U =: C * V
>           V =. %         NB.  Note local  =.
>
>           U fl           NB.  Leaves global C alone, replaces local V with 
> its value
>        C * %
>
> You can read more about  fl  here:  
> http://www.jsoftware.com/jwiki/DanBron/Temp/Fix%20Locals  .
>
> Unfortunately, right now, it's broken, because Roger changed the domain of 
> the (undocumented)  15!:6   foreign in J602.  I'll have to find another way 
> to distinguish  each_base_  from  each_z_  before in order to fix it.
>
> -Dan
>
> PS:  Roger, this change to  15!:6  has tripped me up on a number of 
> occasions?  Was it intentional?  If so, could you share your reasons?  If 
> not, what are the chances of changing it back in J7?
>
> ----------------------------------------------------------------------
> 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