Picky picky :-) v^:(0 ~: '' ($,) :: 1: u)
----- Original Message ----- From: Ewart Shaw <[EMAIL PROTECTED]> Date: Monday, September 25, 2006 7:11 am Subject: Re: [Jprogramming] UpdateWhere conjunction > On Thu, 21 Sep 2006, Roger Hui wrote: > > > v^:u > > > > Beware of the fact that anything nonzero is "true", > so this (delightful!) idiom won't always be equivalent to > Pascal's UpdateWhere: > > NB. begin J session > NB. > UpdateWhere=: 2 : 'if. u y do. v y else. y end.' > (>&0 UpdateWhere *:)"0 i: 3 > _3 _2 _1 0 1 4 9 > (* UpdateWhere *:)"0 i: 3 > 9 4 1 0 1 4 9 > (] UpdateWhere *:)"0 i: 3 > 9 4 1 0 1 4 9 > (*:^:(>&0))"0 i: 3 > _3 _2 _1 0 1 4 9 > (*:^:*)"0 i: 3 > 0j1.73205 0j1.41421 0j1 0 1 4 9 > (*:^:])"0 i: 3 > 1.05988j0.439015 0.840896j0.840896 0j1 0 1 16 6561 > NB. > NB. end J session > > Regards, Ewart Shaw > > > > > > ----- Original Message ----- > > From: Pascal Jasmin <[EMAIL PROTECTED]> > > Date: Thursday, September 21, 2006 6:12 pm > > Subject: [Jprogramming] UpdateWhere conjunction > > > > > What would be a good definition for the following > > > conjunction, or a better way to achieve the same? > > > > > > UpdateWhere=: 2 : 'if. u y do. v y else. y end.' > > > > > > is there a tacit definition? > >... ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
