POV-Ray : Newsgroups : povray.general : fundamental question re: #switch/#case/#break : Re: fundamental question re: #switch/#case/#break Server Time
29 Jul 2024 18:18:23 EDT (-0400)
  Re: fundamental question re: #switch/#case/#break  
From: Le Forgeron
Date: 22 Nov 2010 06:49:25
Message: <4cea58c5$1@news.povray.org>
Le 22/11/2010 11:40, Kenneth a écrit :
> An honestly naive question:  Which mode of operation *should* be correct,
> compared to other standard computational languages?
> 
Both are correct and doing as usual in povray.
(They say the same for me)
The first one is nevertheless more prone to error of interpretation
(because "clause conditional" does not refer to #case/#range (clause)
but to the block (conditional) that is under the #case/#range clause,
even if false)

Traditional computational languages behave the same way:
 when no break, the instructions continue on the following lines.
It's an old tradition.
(a switch/case/break can be rewritten with if/table & goto... including
a goto to exit the switch block (as break): no break, no jump.


Post a reply to this message

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