What Roger so humbly neglected to brag about is the hook ($,) is supported by special code.
In effect, the verb he provided will be instantaneous: ($,) simply updates the tiny piece of memory holding the array's shape with the new shape. The value part of the array won't be touched, or even looked at. -Dan > On Mar 4, 2014, at 4:59 PM, Brian Schott <[email protected]> wrote: > > That's funny. I almost said what you did. Thanks. > > >> On Tue, Mar 4, 2014 at 4:44 PM, Roger Hui <[email protected]> wrote: >> >> f=: ($ -. 1:) ($,) ] >> $ f 3 1 4 1 5 9 $ 'abc' >> 3 4 5 9 >> >> >> >> On Tue, Mar 4, 2014 at 1:38 PM, Brian Schott <[email protected]> >> wrote: >> >>> Is there a general verb that can reshape any noun with 1s in its shape so >>> that the axes with 1s disappear? I know that most often changing >>> calculations slightly can eliminate the 1s before they arise, but not >>> always. >>> >>> For example if $a == 4 1 4 3, is there a verb that will >>> make generalize the result like how ,"_2]1|: does in this case? >>> $,"_2]1|:a == 4 4 3 >>> >>> -- >>> (B=) >>> ---------------------------------------------------------------------- >>> For information about J forums see http://www.jsoftware.com/forums.htm >> ---------------------------------------------------------------------- >> For information about J forums see http://www.jsoftware.com/forums.htm > > > > -- > (B=) <-----my sig > Brian Schott > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
