s1=: ([EMAIL PROTECTED] $ _1:) }. ]
----- Original Message ----- From: Alistair Tucker <[EMAIL PROTECTED]> Date: Thursday, October 4, 2007 6:54 Subject: [Jprogramming] shave=: #@:$ 0&(|:}:) ] To: [email protected] > Hiya, > Thanks for your response Raul, > the verb was intended as a monad to be applied to arrays > of arbitrary rank. It removes the topmost item of each > dimension. Originally shave=: #@:$ 0&(0&|:@:}:@:]) ] > The purpose of the outermost 0& was to produce a phrase that > would repeat (0&|:@:}:@:]) a number #@:$ of times. > You are right to say that the outermost 0& is redundant, > since I can produce the same effect with > shave=: #@:$ 0&(|:}:) ] > However the essentials of the implementation remain the same - I > rotate the array through each and every axis and apply curtail > }: at each step. > Really I meant to ask whether there might not be a better > way to carry out this operation - i.e. to apply curtail }: > through every dimension of an argument. Rotating the array > through its axes in this way must be an expensive process (isn't it?). ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
