The expression (<".x{>y) opens all of y, then selects, executes, and
boxes. The end result is a single box. You're looking for
   numerize =: 3 : '(".&.> x{y) x} y'
. This function selects the appropriate boxes, then opens each box,
executes and closes the box. You can compare the right arguments that
are passed to amend:
   x =. 1 2
   y =. b
   < ". x{>y
┌────────┐
│266239 1│
└────────┘
   ".&.> x{y
┌──────┬─┐
│266239│1│
└──────┴─┘

Marshall

On Sun, Dec 22, 2013 at 08:22:25PM -0000, Ricardo Forno wrote:
> I have this little function:
> numerize =: 13 : '(<".x{>y)x}y'
> It makes numeric the contents of the xth box of the y argument. For
> example, let b:
> b
> ┌─────┬──────┬─┐
> │ALPHA│266239│1│
> └─────┴──────┴─┘
> 
> 1 numerize b makes numeric the middle box.
> Why does it not work with the last two elements of b, namely:
> 1 2 numerize b
> but instead inserts a 2.element vector in each of the boxes 1 and 2?
> Thanks.
> 
> ----------------------------------------------------------------------
> 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