request switch statement with common block

Andre Artus andre.artus at gmail.com
Sat Aug 3 19:45:14 PDT 2013


>>> So, depending on how you define "not worth it", which I take 
>>> "I'm too lazy to implement it", you could be correct.

>> YaAA:
>> If the implementation is so obviously trivial why don't you 
>> implement a proof of concept? The compiler is open source 
>> after all.

> JS:
> because I have better things to do and there is an extreme 
> likelihood it won't be accepted.

So, you have better things to do, but other people are lazy if 
they do not implement something you need but they don't?

It's a proof of concept, you offer it to other users (if you 
build it they will come, or not) who, if they find it as useful 
as you apparently do will lobby on your behalf.

>> YaAA
>> People routinely underestimate the ripple effect that adding 
>> 'trivial' extensions to a language can have on a language.

> JS
> Um, and people routinely don't think hard enough about the 
> problem to realize the feature is an orthogonal semantic that 
> has no bearing on anything but what it does.

It's not true that it has no bearing on anything else.

> JS
> Why do I know this?
>
> Because the feature is short hand notation that can be directly 
> implemented the long way. If the long way doesn't have 
> problems, then the short way does not have any problems(except 
> if your implementation is bad, but that's not the fault of the 
> short way).
>
> I can write a preprocessor to do the things I need to do. I 
> have done it before. The problem is it is hard to make such 
> features robust without some grammatical context such as an ast.

You have the source code for the compiler at your disposal. If 
this is as trivial to implement, and as useful to you, as you 
claim, then I do not see why you cannot knock something together 
to showcase the feature. Are you unwilling to do any work to see 
this feature implemented? If so, how can you impugn the work 
ethic of someone (by implying that they ate lazy), who has 
already donated their time and toil to you, if they follow suit?

Language design is by necessity a conservative affair; it's easy 
for a language to die a death-by-a-thousand-features.

See if you can find some real-world examples of where this 
pattern could be useful.

At the very least you need to specify the construct in more 
detail addressing, for example, the following:
- Does it only work on "final switch" or any switch?
- How are non-integer expressions handled, if at all?
- How does it interpret 'default'?
- How does it deal with range gaps?
- ...


More information about the Digitalmars-d mailing list