The J implementation operates differently from the way you think it does. It might be a good idea for users with detailed suggestions to study the source to see how usecounts are managed.

But let me just say again:

f XXX =: VALUE

and

XXX =: VALUE
f XXX

DO NOT always have the same result. Obviously they don't if XXX is a noun, but they don't have to even if XXX is a name.

This is not really germane to the question of whether an assigned value needs an independent mention in the usecount - that fact is settled by the observation that the name may be deleted while the value is in use, as in my example. But it is a good

Exercise: find values of XXX and VALUE to demonstrate this non-equivalence.

Henry Rich



On 10/6/2016 9:46 PM, Xiao-Yong Jin wrote:
On Oct 6, 2016, at 3:31 PM, Henry Rich <[email protected]> wrote:

Not so fast.  What about

'a b c' =: i. 3
(somenoun) =: somevalue
(+: [ 4!:55@((<'fred')"_)) fred =: 5

In fact, the verb left of the assignment MUST touch the assigning value 
directly.
They touch the value, sure.  Directly?  Depends on your definition.
To my understanding (please correct me if it's false) as long as
    (+: [ 4!:55@((<'fred')"_)) fred =: 5
and the following two sentences
    fred =: 5
    (+: [ 4!:55@((<'fred')"_)) fred
have the same overall effect, which they do, you only need usecount to be one.
Maybe that would require a lot of changes in the code, but I don't see any 
thing wrong with this.
In fact, what ever garbage collection you do now after the completion of one 
sentence, you can do after the completion of one assignment.  Because =: and =. 
are not verb and can't be in a train, anything to the right of =: or =. will 
never be directly used without a name given at the left of =: or =.


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