] x=: 10 ?...@$ 20
17 2 1 9 0 6 7 18 12 17
   x - (2|x) * 1+x
_1 2 _1 _1 0 6 _1 18 12 _1



----- Original Message -----
From: gary ng <[email protected]>
Date: Sunday, September 5, 2010 10:06
Subject: [Jprogramming] replace/amend elements based on certain criteria ?
To: Programming forum <[email protected]>

> Hi,
> 
> What would be the recommended way to do this , say replace every
> element that is odd to '_1' ?
> 
> 0 1 2 3 4 => 0 _1 2 _1 4
> 
> I tried to under stand the 'm } ' verb but don't know how to generate
> the m based on a predicate.
> 
> similarly how about replace the first n  with _1 ?


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to