#...@$ instead of $...@$.  For the overall expression,
,:^:(1...@$)


----- Original Message -----
From: "Philip A. Viton" <[email protected]>
Date: Saturday, March 21, 2009 12:48
Subject: [Jprogramming] setting up a gerund
To: [email protected]

> I want to define a gerund that will promote a rank-1 object 
> (vector) 
> to rank-2 using ,: but will leave rank-0 and rank-2 alone. My 
> gerund 
> is ]`,:`]. For selection, I'm using $...@$, which gives 1 when 
> presented 
> with a vector.
> 
> So putting it together, with vec =. 1 2 3 I try
> 
> (]`,:`]) @. ($...@$) vec
> 
> which is a rank error. On the other hand,  (]`,:`]) @. (1) 
> vec and 
> (]`,:`]) @. (,1) vec seem to work, so evidently the problem is 
> with 
> my rank-determination part ($...@$), but I can't see what's going 
> wrong. 
> Can someone explain it to me? THANKS!!
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to