request switch statement with common block
JS
js.mdnq at gmail.com
Sat Aug 3 18:56:57 PDT 2013
On Saturday, 3 August 2013 at 21:42:00 UTC, Walter Bright wrote:
> On 8/3/2013 12:51 PM, JS wrote:
>> On Saturday, 3 August 2013 at 19:10:19 UTC, Andre Artus wrote:
>>> If the implementation is so obviously trivial why don't you
>>> implement a proof
>>> of concept?
>> because I have better things to do
>
> Implying that our time is of lesser value than yours does not
> help sell your ideas :-)
No, you guys have a vested interest in D and are the owners who
make the final say so... All I can do is present an argument and
watch it get shot down.
The only real solution for me is to develop my own language and
compilers... But I neither have the time nor the intelligence to
do so(at least to do something worthwhile).
But nonetheless, there are certain fundamental properties in
language design. I believe that a compilers ONLY goal is to make
life easier for the programmer. Hence "short form" is key to this
when it does not obfuscate.
I think using the criteria that only denies features that are
useful to only a few programmers is very short sighted.
The reason C++ is better than C is because of it's feature set.
Stuff like i++(short form) is ONLY for convenience... yet every
uses it! NOT because they used it before it exists(obviously) but
because the language supported it and then people were able to
see how useful it is(and some things take a long time.
Basically "How the hell do you know if something is going to be
useful to programmers if the language doesn't support it"? The
answer? You don't! But you can get a good idea if what you are
asking for is a generalization of something.
If X is a generalization of Y and Y is used then chances are X
will be used at some point when people are able to grasp what it
does.
For example, what I am proposing is analogous to class
inheritance. You have a standard base class(the current switch
statement) and a derived class(my extension of the switch). We
can use the derived class anywhere we use the base class(we can
use the standard switch statement even if we have the ability to
use the extended version).
Derivation is always good because it is backwards
compatible(conceptually). My switch statement extension is fully
backwards compatible with the original. Hence, in no way does it
break current usage, so no one can get upset it broke their
program. But it makes the language more robust, easier to
understand in some cases(but not less in any), and is orthogonal
to all other language features(so very little maintenance
issues/unintended consequences).
More information about the Digitalmars-d
mailing list