POV-Ray : Newsgroups : povray.general : POV ignoring my code! : Re: POV ignoring my code! Server Time
5 Aug 2024 10:25:28 EDT (-0400)
  Re: POV ignoring my code!  
From: Philippe Lhoste
Date: 1 Oct 2002 12:03:13
Message: <Xns929AB75C420A7PhiLho@204.213.191.226>
Warp <war### [at] tagpovrayorg> wrote in news:3d99bb63@news.povray.org:

> Rafal 'Raf256' Maj <raf### [at] raf256com> wrote:
>> add #break here, syntax is (mostly) :
> 
>> #range (...)  ...  #break
>> #range (...)  ...  #break
> 
> <off-topic side note>
> 
>   IMHO this is one place where copying the C syntax was not good.
>   It's a lot more common that the coder wants each case in a switch
>   block to 
> be executed alone than to want that the execution continues to the next
> case after the current one.
>   Thus it would make a lot more sense to implicitly assume a #break
>   before 
> any #case or #range command by default, and have a keyword to tell
> povray the contrary (ie. "yes, I really want you to continue with the
> next case after this has been executed").
>   So instead of having a #break keyword, we could have some other
>   keyword 
> for this purpose (which name could be an interesting issue in itself :)
> ). 
> 
> </off-topic side note>

#fallthru?
"Fall through" is a common comment in C code to emphasize the voluntary lack 
of break. http://www.houghi.org/jargon/fall-through.html
Mmm, it is even in the documentation :-)

Unlikely to happen, as it will break old code.

Perhaps it is a good topic for the FAQ, and perhaps the lack of break trap 
should be emphasized in the documentation (or not?).

-- 
--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--
Philippe Lhoste (Paris -- France)
Professional programmer and amateur artist
http://jove.prohosting.com/~philho/


Post a reply to this message

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