D - switch default
- Sean L. Palmer (7/7) May 27 2002 In debug build I got a "switch default" runtime error!
- Carlos (2/6) May 27 2002 it makes no sense to have a default in every switch. it would be like ha...
- Pavel Minayev (6/13) May 27 2002 having
- Carlos (3/4) May 27 2002 it is if you see it under one of 2 (or more) points of view:
-
anderson
(10/13)
May 27 2002
- Pavel Minayev (5/12) May 28 2002 In general, I agree with you. I just told the "official explanation" for
- anderson (8/21) May 28 2002 And before we start another war with the bracket clan :) As long as the
- Pavel Minayev (4/6) May 28 2002 Oh yes, of course. Just remember that #%$@ C# rule that each case-block ...
- Matthew Wilson (5/18) May 28 2002 Surely the cost of writing some code is inconsequential c/w the effort o...
- cblack01 (17/17) May 28 2002 Hey,
- Walter (6/16) May 28 2002 Only partially, via the .classinfo property.
- Matthew Wilson (7/26) May 28 2002 Walter,
- Pavel Minayev (6/10) May 28 2002 is
- Richard Krehbiel (36/47) May 29 2002 ...at which point, I have to mention my favorite design again. :-)
- Patrick Down (16/30) May 29 2002 extern(C) functions could use to old way.
- Pavel Minayev (5/9) May 29 2002 I thought about this as well. It seems like the best approach.
- Walter (5/9) May 29 2002 is
- Pavel Minayev (3/5) May 29 2002 So, what about variants?
- Patrick Down (3/10) May 29 2002 I would vote for a basic variant type too.
- Walter (3/8) Jun 11 2002 They're a good idea, I just need to do more work on it.
- Richard Krehbiel (13/23) May 30 2002 With the a basic variant type and the "array of variants" approach, ever...
- Pavel Minayev (3/6) May 30 2002 Yes, but it is typesafe, and simple to implement.
- Richard Krehbiel (16/22) May 30 2002 every
- Pavel Minayev (8/14) May 31 2002 Forbid such things at all. Variants are not for math, they are to store
- Sean L. Palmer (7/24) May 30 2002 C# is not interpreted... it's always JIT compiled.
- Pavel Minayev (7/9) May 31 2002 AFAIK, there are three modes: JIT-compilation (default), complete
- OddesE (17/26) Jun 03 2002 Mmmm....
- andy (1/17) Jun 03 2002
- OddesE (17/24) Jun 09 2002 No it isn't, the whole .net framework is built on it's
- Pavel Minayev (9/13) Jun 04 2002 DX doesn't really uses COM to its fullest. It provides
- OddesE (17/30) Jun 09 2002 So just say "Automation is slow", not "COM is slow".
- Walter (14/17) Jun 11 2002 That was the theory with Java JITs, too, but the various semantics of th...
- Matthew Wilson (17/36) Jun 11 2002 Guys
- Walter (9/16) May 28 2002 Correct.
- Matthew Wilson (4/20) May 28 2002 Agree that this is a good policy. Now, if only we can get mandatory brac...
In debug build I got a "switch default" runtime error! Is this true, that you *must* provide a default case, and that a switch without a matching case is an error? I dislike the idea of having to provide an explicit default which does nothing, but there may be other reasons for this (safety I guess) Lotta little things to get used to in D. ;) Sean
May 27 2002
Is this true, that you *must* provide a default case, and that a switch without a matching case is an error? I dislike the idea of having to provide an explicit default which does nothing, but there may be other reasons for this (safety I guess)it makes no sense to have a default in every switch. it would be like having an else in every single if.
May 27 2002
"Carlos" <carlos8294 msn.com> wrote in message news:acurl4$g05$1 digitaldaemon.com...havingIs this true, that you *must* provide a default case, and that a switch without a matching case is an error? I dislike the idea of having to provide an explicit default which does nothing, but there may be other reasons for this (safety I guess)it makes no sense to have a default in every switch. it would be likean else in every single if.Not really so. It helps to resolve problems like when you add a new member to an enum, and forget to add the appropriate case for it. And besides, is a single "default:" at the end of case so hard to type?
May 27 2002
And besides, is a single "default:" at the end of case so hard to type?it is if you see it under one of 2 (or more) points of view: 1) under logical eyes (already explained) 2) under the eyes of a common C programmer
May 27 2002
"Pavel Minayev" <evilone omen.ru> wrote in message news:acuuif$kq6$1 digitaldaemon.com..."Carlos" <carlos8294 msn.com> wrote in message news:acurl4$g05$1 digitaldaemon.com...<Snip>And besides, is a single "default:" at the end of case so hard to type?1. The less code often makes things quicker to read (compare reading point for to an essay). 2. Allowing optional components don't make things much more difficult. 3. If you can shave 10% of typing in a program, that's 10% more time to spend elsewhere. I agree that a language needs to be strongly typed, but something like not using "default:" isn't going to cause that many more errors.
May 27 2002
"anderson" <anderson firestar.com.au> wrote in message news:acv659$tb5$1 digitaldaemon.com...1. The less code often makes things quicker to read (compare reading point for to an essay). 2. Allowing optional components don't make things much more difficult. 3. If you can shave 10% of typing in a program, that's 10% more time to spend elsewhere. I agree that a language needs to be strongly typed, but something like not using "default:" isn't going to cause that many more errors.In general, I agree with you. I just told the "official explanation" for this feature.
May 28 2002
And before we start another war with the bracket clan :) As long as the language is much better then C++ these things are really very insignficant. PS - I wonder if they had the same arguments when inventing A,B,C, C++ and "Pavel Minayev" <evilone omen.ru> wrote in message news:ad0218$27n0$1 digitaldaemon.com..."anderson" <anderson firestar.com.au> wrote in message news:acv659$tb5$1 digitaldaemon.com...point1. The less code often makes things quicker to read (compare readingnotfor to an essay). 2. Allowing optional components don't make things much more difficult. 3. If you can shave 10% of typing in a program, that's 10% more time to spend elsewhere. I agree that a language needs to be strongly typed, but something likeusing "default:" isn't going to cause that many more errors.In general, I agree with you. I just told the "official explanation" for this feature.
May 28 2002
"anderson" <anderson firestar.com.au> wrote in message news:ad035g$2960$1 digitaldaemon.com...PS - I wonder if they had the same arguments when inventing A,B,C, C++ andbe terminated...
May 28 2002
Surely the cost of writing some code is inconsequential c/w the effort of diagnosing bugs and/or maintaining & updating code? Or have I missed something fundamental in all these years ... ? ;) "anderson" <anderson firestar.com.au> wrote in message news:acv659$tb5$1 digitaldaemon.com..."Pavel Minayev" <evilone omen.ru> wrote in message news:acuuif$kq6$1 digitaldaemon.com..."Carlos" <carlos8294 msn.com> wrote in message news:acurl4$g05$1 digitaldaemon.com...<Snip>And besides, is a single "default:" at the end of case so hard to type?1. The less code often makes things quicker to read (compare reading point for to an essay). 2. Allowing optional components don't make things much more difficult. 3. If you can shave 10% of typing in a program, that's 10% more time to spend elsewhere. I agree that a language needs to be strongly typed, but something like not using "default:" isn't going to cause that many more errors.
May 28 2002
Hey, reflection? parameters using the params keyword like this: void Print(params string stuffToPrint[]) { foreach(oneThing in stuffToPrint) System.Console.WriteLn(oneThing); } Then you would call it like this: Print("Printing ", "variable ", "parameters"); use it since I do a lot of scientific applications that are too Thanks, Craig
May 28 2002
"cblack01" <cblack01 cox.net> wrote in message news:ad0rbq$88q$1 digitaldaemon.com...reflection?Only partially, via the .classinfo property.variableparameters using the params keyword like this: void Print(params string stuffToPrint[]) { foreach(oneThing in stuffToPrint) System.Console.WriteLn(oneThing); } Then you would call it like this: Print("Printing ", "variable ", "parameters");D does variable parameter lists exactly like C does. While not typesafe, it is efficient.
May 28 2002
Walter, good. Would the performance be prohibitive? Do you have any figures/impressions as to how much it would cost? "Walter" <walter digitalmars.com> wrote in message news:ad0uv7$cbc$1 digitaldaemon.com..."cblack01" <cblack01 cox.net> wrote in message news:ad0rbq$88q$1 digitaldaemon.com...itreflection?Only partially, via the .classinfo property.variableparameters using the params keyword like this: void Print(params string stuffToPrint[]) { foreach(oneThing in stuffToPrint) System.Console.WriteLn(oneThing); } Then you would call it like this: Print("Printing ", "variable ", "parameters");D does variable parameter lists exactly like C does. While not typesafe,is efficient.
May 28 2002
"Matthew Wilson" <mwilson nextgengaming.com> wrote in message news:ad1mcg$2bir$1 digitaldaemon.com...Walter,isgood. Would the performance be prohibitive? Do you have any figures/impressions as to how much it would cost?After all, both ways could be left, old C-style for printf (and whoever cares of perfomance can always use it), and something new, safe and easy to use.
May 28 2002
"Pavel Minayev" <evilone omen.ru> wrote in message news:ad1qrq$2hau$1 digitaldaemon.com..."Matthew Wilson" <mwilson nextgengaming.com> wrote in message news:ad1mcg$2bir$1 digitaldaemon.com......at which point, I have to mention my favorite design again. :-) void takes_variable_args(int... args) { } This function takes a variable number of arguments, all of type int. The variable "args" really has the type "int[] args" (just as, in C, a function parameter declared with [] really has type "pointer to..."). The "..." variation indicates that, when the caller codes separate function parameters, they are collected for the user into a dynamic array. class ArgType { this(char[] var) { } this(int var) { } } void mixed_types(ArgType... args) { } The arguments are collected into a dynamic array "ArgType[] args" where ArgType is some user-defined class. The arguments given must be of the parameter type; else a derived type; else an instance of the parameter type must be constructible using the given expression; else it's an error. So when the user writes this: ArgType myVar; mixed_types(myVar, 1, "string"); ...this would compile *as if* the user had coded: ArgType[] _temp_; _temp_.length = 3; _temp_[0] = myVar; _temp_[1] = new ArgType(1); _temp_[2] = new ArgType("string"); mixed_types(_temp_); -- Richard Krehbiel, Arlington, VA, USA rich kastle.com (work) or krehbiel3 comcast.net (personal)Walter, is good. Would the performance be prohibitive? Do you have any figures/impressions as to how much it would cost?After all, both ways could be left, old C-style for printf (and whoever cares of perfomance can always use it), and something new, safe and easy to use.
May 29 2002
"Pavel Minayev" <evilone omen.ru> wrote in news:ad1qrq$2hau$1 digitaldaemon.com:"Matthew Wilson" <mwilson nextgengaming.com> wrote in message news:ad1mcg$2bir$1 digitaldaemon.com...extern(C) functions could use to old way. There is already a typeInfo class for a lot of types. Why not automatically push the number of parameters and then push pairs of TypeInfo references and values? It would nice to have a replacement for the va* macros too. void func(vararg,...) { for(int i = 0; i < vararg.length; ++i) { TypeInfo t = vararg.GetType(i); void* pv = vararg.getValue(i); } }Walter, implementationisgood. Would the performance be prohibitive? Do you have any figures/impressions as to how much it would cost?After all, both ways could be left, old C-style for printf (and whoever cares of perfomance can always use it), and something new, safe and easy to use.
May 29 2002
"Patrick Down" <pat codemoon.com> wrote in message news:Xns921D6A359FF5Apatcodemooncom 63.105.9.61...I thought about this as well. It seems like the best approach. "..." is already known to C/C++ programmers to indicate vararg function, why break the tradition?After all, both ways could be left, old C-style for printf (and whoever cares of perfomance can always use it), and something new, safe and easy to use.extern(C) functions could use to old way.
May 29 2002
"Matthew Wilson" <mwilson nextgengaming.com> wrote in message news:ad1mcg$2bir$1 digitaldaemon.com...Walter,isgood. Would the performance be prohibitive? Do you have any figures/impressions as to how much it would cost?The proper way to do it would be to create a variant type, and then have variable parameter lists be passed as arrays of variants.
May 29 2002
"Walter" <walter digitalmars.com> wrote in message news:ad3pg0$2hgm$1 digitaldaemon.com...The proper way to do it would be to create a variant type, and then have variable parameter lists be passed as arrays of variants.So, what about variants?
May 29 2002
"Pavel Minayev" <evilone omen.ru> wrote in news:ad4d3a$83g$1 digitaldaemon.com:"Walter" <walter digitalmars.com> wrote in message news:ad3pg0$2hgm$1 digitaldaemon.com...I would vote for a basic variant type too.The proper way to do it would be to create a variant type, and then have variable parameter lists be passed as arrays of variants.So, what about variants?
May 29 2002
"Pavel Minayev" <evilone omen.ru> wrote in message news:ad4d3a$83g$1 digitaldaemon.com..."Walter" <walter digitalmars.com> wrote in message news:ad3pg0$2hgm$1 digitaldaemon.com...They're a good idea, I just need to do more work on it.The proper way to do it would be to create a variant type, and then have variable parameter lists be passed as arrays of variants.So, what about variants?
Jun 11 2002
"Walter" <walter digitalmars.com> wrote in message news:ad3pg0$2hgm$1 digitaldaemon.com..."Matthew Wilson" <mwilson nextgengaming.com> wrote in message news:ad1mcg$2bir$1 digitaldaemon.com...With the a basic variant type and the "array of variants" approach, every type is always a valid parameter type. Same with the C/C++ varargs approach. May I direct your attention? news://news.digitalmars.com/ad2ead$a6i$1 digitaldaemon.com With my approach the compiler will enforce legal argument types; but if you want to code up a universal Variant class and use it, you may. IMHO I'd rather avoid having "variant" be a basic type in the language. -- Richard Krehbiel, Arlington, VA, USA rich kastle.com (work) or krehbiel3 comcast.net (personal)Walter,isgood. Would the performance be prohibitive? Do you have any figures/impressions as to how much it would cost?The proper way to do it would be to create a variant type, and then have variable parameter lists be passed as arrays of variants.
May 30 2002
"Richard Krehbiel" <rich kastle.com> wrote in message news:ad53sp$1847$1 digitaldaemon.com...With the a basic variant type and the "array of variants" approach, every type is always a valid parameter type. Same with the C/C++ varargs approach.Yes, but it is typesafe, and simple to implement.
May 30 2002
"Pavel Minayev" <evilone omen.ru> wrote in message news:ad5kht$1hlr$1 digitaldaemon.com..."Richard Krehbiel" <rich kastle.com> wrote in message news:ad53sp$1847$1 digitaldaemon.com...everyWith the a basic variant type and the "array of variants" approach,My version is "stronger" (it can enforce vararg parameter types at compile time; the variant accepts every type) and I fail to see how injecting a basic type as disruptive as "variant" would be simpler. variant a, b, c; a = b + c; Integer, or floating point math? Vector sum? Can't tell. The compiler must generate code to sense types and perform every valid operation at run time. Or else, call it illegal to perform operatins on "variant," and rule that they must be converted to real types before anything can be done with them. -- Richard Krehbiel, Arlington, VA, USA rich kastle.com (work) or krehbiel3 comcast.net (personal)type is always a valid parameter type. Same with the C/C++ varargs approach.Yes, but it is typesafe, and simple to implement.
May 30 2002
"Richard Krehbiel" <rich kastle.com> wrote in message news:ad5sul$2q3r$1 digitaldaemon.com...My version is "stronger" (it can enforce vararg parameter types at compile time; the variant accepts every type) and I fail to see how injecting a basic type as disruptive as "variant" would be simpler. variant a, b, c; a = b + c; Integer, or floating point math? Vector sum? Can't tell. The compilerForbid such things at all. Variants are not for math, they are to store (and pass to functions) values of diffenrent types, varying at run-time. Variant math should clearly be forbidden, and explicit cast required for such cases: variant a, b, c; a = cast(int)b + cast(int)c;
May 31 2002
It should in theory be able to be as fast as C++. Sean "cblack01" <cblack01 cox.net> wrote in message news:ad0rbq$88q$1 digitaldaemon.com...Hey, reflection?variableparameters using the params keyword like this: void Print(params string stuffToPrint[]) { foreach(oneThing in stuffToPrint) System.Console.WriteLn(oneThing); } Then you would call it like this: Print("Printing ", "variable ", "parameters");neveruse it since I do a lot of scientific applications that are too Thanks, Craig
May 30 2002
"Sean L. Palmer" <seanpalmer earthlink.net> wrote in message news:ad5q85$2mv2$1 digitaldaemon.com...AFAIK, there are three modes: JIT-compilation (default), complete precompilation, and straight interpretation.It should in theory be able to be as fast as C++.As long as it uses COM, I doubt it will be as fast even when programs are precompiled into native code.
May 31 2002
"Pavel Minayev" <evilone omen.ru> wrote in message news:ad7b97$1sis$1 digitaldaemon.com..."Sean L. Palmer" <seanpalmer earthlink.net> wrote in message news:ad5q85$2mv2$1 digitaldaemon.com...Mmmm.... Java also uses JIT compiling doesn't it? It takes every lame little Java program an age to start because of this....It is definitely not as fast as native code!AFAIK, there are three modes: JIT-compilation (default), complete precompilation, and straight interpretation.It should in theory be able to be as fast as C++.As long as it uses COM, I doubt it will be as fast even when programs are precompiled into native code.COM is not slow. Even DirectX uses COM and they would never do that if it really were slow. Ofcourse when you use COM to build a remote component to be accessed over the internet that's slow... :) But when you just use a .dll it is fast. -- Stijn OddesE_XYZ hotmail.com http://OddesE.cjb.net _________________________________________________ Remove _XYZ from my address when replying by mail
Jun 03 2002
COM is not slow. Even DirectX uses COM and they would never do that if it really were slow. Ofcourse when you use COM to build a remote component to be accessed over the internet that's slow... :) But when you just use a .dll it is fast.And its deprecated.-- Stijn OddesE_XYZ hotmail.com http://OddesE.cjb.net _________________________________________________ Remove _XYZ from my address when replying by mail
Jun 03 2002
"andy" <acoliver apache.org> wrote in message news:3CFBCFB5.2070304 apache.org...No it isn't, the whole .net framework is built on it's foundations. That's just the usual 'Microsoft Marketing Blabber' (tm). The are not about to deprecate the milions of lines of code written with COM. Just think of your excel sheet embedded in your Word document (OLE), all the Windows Explorer extension, all the ActiveX controls, allmost all the games written in the last few years, etcetera, etcetera, etcetera. Ofcourse they do want you to switch to .net, but that is another story. -- Stijn OddesE_XYZ hotmail.com http://OddesE.cjb.net _________________________________________________ Remove _XYZ from my address when replying by mailCOM is not slow. Even DirectX uses COM and they would never do that if it really were slow. Ofcourse when you use COM to build a remote component to be accessed over the internet that's slow... :) But when you just use a .dll it is fast.And its deprecated.
Jun 09 2002
No it isn't, the whole .net framework is built on it's foundations. That's just the usual 'Microsoft Marketing Blabber' (tm). The are not about to deprecate the milions of lines of code written with COM. Just think of your excel sheet embedded in your Word document (OLE), all the Windows Explorer extension, all the ActiveX controls, allmost all the games written in the last few years, etcetera, etcetera, etcetera. Ofcourse they do want you to switch to .net, but that is another story.You're right. I was thinking of MFC.-- Stijn OddesE_XYZ hotmail.com http://OddesE.cjb.net _________________________________________________ Remove _XYZ from my address when replying by mail
Jun 09 2002
"andy" <acoliver apache.org> wrote in message news:3D03D095.6090807 apache.org...And good riddance! ;) -- Stijn OddesE_XYZ hotmail.com http://OddesE.cjb.net _________________________________________________ Remove _XYZ from my address when replying by mailNo it isn't, the whole .net framework is built on it's foundations. That's just the usual 'Microsoft Marketing Blabber' (tm). The are not about to deprecate the milions of lines of code written with COM. Just think of your excel sheet embedded in your Word document (OLE), all the Windows Explorer extension, all the ActiveX controls, allmost all the games written in the last few years, etcetera, etcetera, etcetera. Ofcourse they do want you to switch to .net, but that is another story.You're right. I was thinking of MFC.
Jun 11 2002
"OddesE" <OddesE_XYZ hotmail.com> wrote in message news:adgi89$276q$1 digitaldaemon.com...COM is not slow. Even DirectX uses COM and they would never do that if it really were slow. Ofcourse when you use COM to build a remote component to be accessed over the internet that's slow... :) But when you just use a .dll it is fast.DX doesn't really uses COM to its fullest. It provides functions to create DX objects fast, without using the slow-as-hell COM/Automation mechanisms (CoCreateInstance etc). It does not use dual interfaces, as far as I know. It does not use SAFEARRAY and BSTR. Etc etc etc. Just compare DX VB library (COM!) to DX C++ library (COM?), and see the difference in speed...
Jun 04 2002
"Pavel Minayev" <evilone omen.ru> wrote in message news:adhor6$dqa$1 digitaldaemon.com..."OddesE" <OddesE_XYZ hotmail.com> wrote in message news:adgi89$276q$1 digitaldaemon.com...So just say "Automation is slow", not "COM is slow". Automation is a superset of COM, it's like comparing C++ to C, they are just not the same thing. And I agree that automation is slow, but there are benefits to compensate for this. DirectX does use CoCreateInstance, it is just wrapped in a more user-friendly call. However after you have created the first object all others are created through calls to this object. -- Stijn OddesE_XYZ hotmail.com http://OddesE.cjb.net _________________________________________________ Remove _XYZ from my address when replying by mailCOM is not slow. Even DirectX uses COM and they would never do that if it really were slow. Ofcourse when you use COM to build a remote component to be accessed over the internet that's slow... :) But when you just use a .dll it is fast.DX doesn't really uses COM to its fullest. It provides functions to create DX objects fast, without using the slow-as-hell COM/Automation mechanisms (CoCreateInstance etc). It does not use dual interfaces, as far as I know. It does not use SAFEARRAY and BSTR. Etc etc etc. Just compare DX VB library (COM!) to DX C++ library (COM?), and see the difference in speed...
Jun 09 2002
"Sean L. Palmer" <seanpalmer earthlink.net> wrote in message news:ad5q85$2mv2$1 digitaldaemon.com...It should in theory be able to be as fast as C++. SeanThat was the theory with Java JITs, too, but the various semantics of the language seem to have defeated that. For example, arrays are always objects allocated on the heap, and they are always bounds checked. The translation layer needed to interface with C doesn't help. The biggest slowdown is probably the lack of lightweight objects. No support for byte chars hurts. I could go on ... <g>. Some experiments show that expert Java programmers can approach the speed of C++, but it shouldn't be necessary to be in that top 1% to get fast code. D has some features which will make it slower than C/C++, and some that will make it faster. It's too soon to tell how on balance it will work out. The neat thing about D is you should be able to get the reliability of Java with the performance of C/C++.
Jun 11 2002
Guys I wrote an article for CUJ, which Walter helped a little with, that is being published in the September edition. It was entitled "A performance are very good performers on the Win32 platform, and although one can get C/C++ to outperform, it requires explicit coding to that end (which kind of defeats the purpose, for most scenarios) Walter, I haven't heard back from the publisher re my forwarding you a pre-print, so assume I cannot. It'll be out in 8 weeks, though ... ;) "Walter" <walter digitalmars.com> wrote in message news:ae4ctn$1udb$1 digitaldaemon.com..."Sean L. Palmer" <seanpalmer earthlink.net> wrote in message news:ad5q85$2mv2$1 digitaldaemon.com...objectsIt should in theory be able to be as fast as C++. SeanThat was the theory with Java JITs, too, but the various semantics of the language seem to have defeated that. For example, arrays are alwaysallocated on the heap, and they are always bounds checked. The translation layer needed to interface with C doesn't help. The biggest slowdown is probably the lack of lightweight objects. No support for byte chars hurts.Icould go on ... <g>. Some experiments show that expert Java programmers can approach the speedofC++, but it shouldn't be necessary to be in that top 1% to get fast code. D has some features which will make it slower than C/C++, and some thatwillmake it faster. It's too soon to tell how on balance it will work out. The neat thing about D is you should be able to get the reliability of Javawiththe performance of C/C++.
Jun 11 2002
"Sean L. Palmer" <seanpalmer earthlink.net> wrote in message news:acurhn$foq$1 digitaldaemon.com...In debug build I got a "switch default" runtime error! Is this true, that you *must* provide a default case, and that a switch without a matching case is an error?Correct.I dislike the idea of having to provide an explicit default which does nothing, but there may be other reasons for this (safety I guess)The reason for it is all the bugs I've had over the years where I add another value to something, and forget to add a case for it in a corresponding switch somewhere in the code. It means one must be explicit about ignoring the default case.Lotta little things to get used to in D. ;)Yup <g>. D doesn't have one killer feature, it is more the aggregate of a lot of little things.
May 28 2002
Agree that this is a good policy. Now, if only we can get mandatory braces ... ;) "Walter" <walter digitalmars.com> wrote in message news:ad0tkb$as8$1 digitaldaemon.com..."Sean L. Palmer" <seanpalmer earthlink.net> wrote in message news:acurhn$foq$1 digitaldaemon.com...In debug build I got a "switch default" runtime error! Is this true, that you *must* provide a default case, and that a switch without a matching case is an error?Correct.I dislike the idea of having to provide an explicit default which does nothing, but there may be other reasons for this (safety I guess)The reason for it is all the bugs I've had over the years where I add another value to something, and forget to add a case for it in a corresponding switch somewhere in the code. It means one must be explicit about ignoring the default case.Lotta little things to get used to in D. ;)Yup <g>. D doesn't have one killer feature, it is more the aggregate of a lot of little things.
May 28 2002