--000e0cd24e8ca649960474c34682
Content-Type: text/plain; charset=ISO-8859-1

On Tue, Sep 29, 2009 at 11:24 AM, Jake Brightmatter
<brightmatter / gmail.com>wrote:

> have this code in Java:
>
> boolean monkey  rue;
> for(i 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.
> --
> Posted via http://www.ruby-forum.com/.
>
>
I know you are asking about the Ruby, but in your Java code, using the
variable monkey is rather confusing, and doesn't seem to have any purpose
except to hold the value true, to submit to the conditional portion of your
for loop. This isn't necessary, as you can directly place true into that
location:

for( i; true ; ++i )

--000e0cd24e8ca649960474c34682--