haXe Forum > switch-case
-
kudos kudosen Mar 08 at 12:20
Hi!
What was the motivation for implicit adding break in a switch-case statement? (it got me into real problems trying to refactor the code)-kudos
-
Nick Sabalausky Mar 08 at 18:53
Implicit fallthrough is widely considered error-prone and generally not useful for much more than duff's device (which would probably only achieve negligible gains, if any, on most of the platforms Haxe supports anyway).
-
Nick Sabalausky Mar 09 at 01:31
Not sure what I was thinking when I wrote that. It's goto that useful for duff's and not much else. Switch fallthrough certainly has its uses. It's just that implicit fallthrough is error-prone.
-
kudos kudosen Mar 09 at 01:54
Hi! thanks for the reply!
yes, duff's device :-) stuff that has been almost forgotten. I am just curious, what kind of tools do you use (I made a wild guess that you are one of the developers) to assemble swf files? An (not so fragile) assembler would be quite useful
-
Nick Sabalausky Mar 09 at 03:31
No, I'm not one of Haxe's developers. In fact, I'm only assuming that what I wrote above is the reason they didn't do implicit fallthrough. For all I know, it could have been a bet or something :). Guess I wasn't too clear on that.
.
I don't know about other people, or the haxe devs, but I build my swfs by using swfmill to create a resource swf that just contains the resources (images/audio files) that I want built-in (anything except the stuff I stream in at runtime), and then I use the "-swf-lib" switch in my hxml file to have haxe include that resource swf when it builds an swf from my haxe code.