Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!ncar!gatech!mcnc!uvaarpa!haven!ni.umd.edu!uc780.umd.edu!cs450a03 From: cs450a03@uc780.umd.edu Newsgroups: comp.lang.apl Subject: RE: Do While in J? Message-ID: <23MAR91.00430776@uc780.umd.edu> Date: 23 Mar 91 00:43:07 GMT References: Sender: usenet@ni.umd.edu (USENET News System) Organization: The University of Maryland University College Lines: 50 Nntp-Posting-Host: uc780.umd.edu Well, since I've got J 3.0 with 2.9 docs, I suppose I can answer this one... (Note, this has been tested on sun4 J 2.9) nz =. ''::'x. }:^:(0=y.) y.' 3 nz 4 4 3 nz 2 2 3 nz 0 3 f =. 0: . , . nz . ({~) : 1 data=. 1 0 0 _1 0 0 1 0 0 2 0 0 3 data f 13 0 0 1 1 1 _1 _1 _1 1 1 1 2 2 2 3 data f (#data);i.0 1 1 1 _1 _1 _1 1 1 1 2 2 2 3 f =. 2&= . , . nz . ({~) : 1 data f (#data);i.0 1 1 1 _1 _1 _1 1 1 1 (I think, I didn't actually test this last variant, but it matches my experience) ' given ':{ ger=. w . g . m . s f =. ger : 1 ' then: ':{ x f n;