POV-Ray : Newsgroups : povray.general : The Language of POV-Ray : Re: The Language of POV-Ray Server Time
11 Aug 2024 09:19:33 EDT (-0400)
  Re: The Language of POV-Ray  
From: Jon A  Cruz
Date: 12 Mar 2000 11:48:39
Message: <38CBCBF6.B34A1374@geocities.com>
Nieminen Juha wrote:

>   You are right.
>   However I think there are some places where the use of goto (at least in
> C and C++) is more or less reasonable:
>
> - Case 1:
>
>   for(cond1)
>     for(cond2)
>       while(cond3)
>         if(skip) goto end_loops;
>
> end_loops:
>   ...
>
> - Case 2:
>
> recalculate_initial_values:
>   make_some_calculations;
>   for(cond1)
>     for(cond2)
>       while(cond3)
>         if(wrong_values) goto recalculate_initial_values;
>
> - Case 3:
>
>   calculation1;
>   if(error) goto end_calculations;
>   calculation2;
>   if(error) goto end_calculations;
>   calculation3;
>   if(error) goto end_calculations;
>   calculation4;
>   if(error) goto end_calculations;
>
>   handle_results;
>
> end_calculations:
>   clean_up;

Of those, only case 3 looks like possibly decent use.  Case 1 and 2 look very
problematic.

--
"My new computer's got the clocks, it rocks
But it was obsolete before I opened the box" - W.A.Y.


Post a reply to this message

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