|
![](/i/fill.gif) |
Nieminen Juha wrote in message <38cb9a68@news.povray.org>...
> Also this new syntax would be very handy sometimes:
>
>#do
> ...
>#until(whatever)
>
> There really are times, where you want to execute the body of the loop at
>least once before the ending condition is tested (for example the condition
>is calculated in the body of the loop).
> With the current #while-loop you would have to calculate the condition
>in two places: First before the loop, and then inside the loop. Copying the
>same code to several places is not a good thing.
Adding this to the parser would be pure hell. EVERY other code block in the
language ends with "#end", making it impossible to mismatch block the start
and end of a block. However, a "#do...#until()" would allow constructs such
as:
#do
/* Do something */
#if(1 = 2)
#until(a = 3)
#end
or
#do
/* Do something */
#if(1 = 1)
#until(a = 3)
#end
The parser would need to be able to recognize this sort of construct and
then recognize that the first case will cause serious problems, but the
second one is fine.
Mark
Post a reply to this message
|
![](/i/fill.gif) |