'a b c' =: i. 3 result could be copied in multi assignment? (so usecount =1 for copy)
(somenoun) =: somevalue current behaviour. Can't optimize a reassignment anyway if somenoun is an expression. (+: [ 4!:55@((<'fred')"_)) fred =: 5 annoying for sure, but this would not cause problems: (4!:55@((<'fred')"_) ] +:) fred =: 5 so side-effect code like this can still be done, and in the first form, it would raise an error that helps you fix your code. ----- Original Message ----- From: Henry Rich <[email protected]> To: [email protected] Sent: Thursday, October 6, 2016 4:31 PM Subject: Re: [Jbeta] 9!:53 question 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. Henry Rich On 10/6/2016 4:25 PM, Xiao-Yong Jin wrote: >> On Oct 6, 2016, at 2:51 PM, Henry Rich <[email protected]> wrote: >> >>> On the other hand the sentence >>> a =: ('b' ,~ 3 ,~ ]) a=: 3 1 4 1 5 9 2 >> This is not inplaceable because the block has a usecount of 2 after the >> assignment > I don't understand why the usecount has to increase after the assignment. > I guess it's not related to literal, because the sentence > a=:('b',~3,~])a=:i.5 > is not inplaced either. So the data (0 1 2 3 4) from the executing of i.5, > have a usecount of 2 after the assignment. It is very counterintuitive, > because any verb left of the assignment is not able to touch the result of > i.5 directly without going through the reference from a. I guess in > principle, after massive amount of change to the reference counting part of > the code, we could make it such that the use count is one after assignment of > name=:(data without a name) immediately. > ---------------------------------------------------------------------- > 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
