POV-Ray : Newsgroups : povray.pov4.discussion.general : I want to be rid of my stupid mistakes : Re: I want to be rid of my stupid mistakes Server Time
16 May 2024 07:50:57 EDT (-0400)
  Re: I want to be rid of my stupid mistakes  
From: scott
Date: 21 Jul 2009 09:38:23
Message: <4a65c4cf@news.povray.org>
> What if we're talking about a loop like this:
>
>  #declare abortProb = 0.03;
>  #while(rand(R) > abortProb)
>    //...
>  #end

Well rand() gives a different answer each time, so that can automatically be 
counted as being reassigned in the eyes of the infinite-loop-catcher.  If 
you try to implement your own RNG in a macro then obviously the random 
variable will be reassigned so that would also count.

> I do know I keep repeating myself, but: Why on earth try to come up with
> ever-so-complex ways to detect a broken counting #while loop without 
> breaking
> other uses of the #while statement, when really the root problem is the 
> absence
> of a proper #for loop?

Agreed.  Although I still think you could detect some common infinite loop 
situations without breaking any existing behaviour.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.