From: bbiker Date: 2009-09-30T11:10:05+09:00 Subject: Re: syntax translation Java - Ruby On Sep 29, 12:32 pm, Paul Smith wrote: > On Tue, Sep 29, 2009 at 5:24 PM, Jake Brightmatter > > > > > > wrote: > > have this code in Java: > > > boolean monkey = true; > > for(i=0; monkey; i++){ > >  if(index[i] == null) { > >    put.something.new(i); > >    break; > >  } > > } > > > I am aware that it makes no sense by itself so I will explain.  I am > > iterating through a (Sequel) database nodes.  I am looking for a node > > I.D. that is not being used.  Basically, I am looking for and open > > parking spot.  When I find one, I insert my new data using the newly > > found parking spot. I really can't figure out why I need to uniquely > > identify each node by an I.D. as it is already uniquely identified by > > location in the tree but that is a different matter entirely.  All I > > need is how to write a nice infinite 'for' loop in Ruby. > > loop {} > > > -- > > Posted viahttp://www.ruby-forum.com/. > > -- > Paul Smithhttp://www.nomadicfun.co.uk > > p...@pollyandpaul.co.uk An alternate way while true do # your code # break if end renard@nc.rr.com