> I guess you meant $$,

Yes, I did. I had that originally, then (wrongly) decided I could do
without the (,).

> Roger suggested other idioms for copy-by-value but no promise that they
> will work for ever.

That's what's worrying me. My code (if successful) will be buried in
middleware, and risks breaking in years to come. But I guess that's
true of all modern code.

There's almost a case here for another foreign, eg. ownmem=: 128!:8


On Sat, May 28, 2011 at 12:00 AM, bill lam <[email protected]> wrote:
> I guess you meant $$,
>
> x rho y in APL is equivalent to x ($,) y in J if I remember correctly.
>
> Roger suggested other idioms for copy-by-value but no promise that they
> will work for ever.
>
> Птн, 27 Май 2011, Ian Clark писал(а):
>> Been experimenting with mapped files...
>> Looking for a reliable way to detect if a mapped file has changed
>> since I last inspected it.
>>
>> If pronoun: TITLE is mapped to a file, then
>>    sav=: TITLE
>> will create: sav -as not a copy but an alias of TITLE. (Not
>> surprisingly, because they share the same memory.)
>>
>> Thus reassigning sav will change TITLE too, and vice-versa. Which
>> makes: sav=:TITLE no good as a way of snapshotting TITLE to detect
>> changes.
>>
>> 1. Can you think of a low-overhead verb: own -used like so:
>>    sav=: own TITLE
>> -which will force J to allocate sav its own separate space in memory?
>>
>> I've tried these:
>> own=: ]
>> own=: [: > [: {: 0 ; <
>> own=: $ $ ]
>>
>> The first 2 don't work: sav keeps in step with TITLE, thanks to J's
>> optimisation.
>> The third defn works --but for how much longer? At some future date it
>> might break, thanks to improved J optimisation.
>>
>> 2. Is there a more elegant way of checking whether a mapped file has changed?
>>
>>    When I change a mapped noun I cannot see any changes to:
>> showmap_jmf_'' --this is on a Mac.
>>    I can repeatedly read the directory entry using 1!:0 and watch for
>> it to change (as its timestamp gets updated). The processing overhead
>> is tolerable, but is it the best I can do?
>> ----------------------------------------------------------------------
>> 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