https://issues.dlang.org/show_bug.cgi?id=6176
Iain Buclaw changed:
What|Removed |Added
Priority|P2 |P3
--
https://issues.dlang.org/show_bug.cgi?id=6176
Sobirari Muhomori dfj1es...@sneakemail.com changed:
What|Removed |Added
See Also|
https://issues.dlang.org/show_bug.cgi?id=6176
Andrei Alexandrescu and...@erdani.com changed:
What|Removed |Added
Version|unspecified |D2
--
http://d.puremagic.com/issues/show_bug.cgi?id=6176
--- Comment #16 from bearophile_h...@eml.cc 2012-01-18 04:40:14 PST ---
(In reply to comment #13)
There are two very different use cases in D here.
An option is to add another kind of switch attribute:
enum switch (foo) {
case c1: break;
http://d.puremagic.com/issues/show_bug.cgi?id=6176
--- Comment #17 from Stewart Gordon s...@iname.com 2012-01-18 06:45:23 PST ---
(In reply to comment #16)
(In reply to comment #13)
There are two very different use cases in D here.
An option is to add another kind of switch attribute:
http://d.puremagic.com/issues/show_bug.cgi?id=6176
--- Comment #18 from bearophile_h...@eml.cc 2012-01-18 09:53:06 PST ---
(In reply to comment #17)
We already have an enum switch - it's called final switch.
The purpose of this idea is different. A final switch requires to list all
http://d.puremagic.com/issues/show_bug.cgi?id=6176
--- Comment #19 from Jonathan M Davis jmdavisp...@gmx.com 2012-01-18 10:01:02
PST ---
Personally, I think that simplest and best solution is to just restrict case
statements to compile-time constants like every language does. I agree with Don
http://d.puremagic.com/issues/show_bug.cgi?id=6176
--- Comment #20 from bearophile_h...@eml.cc 2012-01-18 10:06:02 PST ---
(In reply to comment #19)
Personally, I think that simplest and best solution is to just restrict case
statements to compile-time constants like every language does.
I
http://d.puremagic.com/issues/show_bug.cgi?id=6176
Andrej Mitrovic andrej.mitrov...@gmail.com changed:
What|Removed |Added
CC|
http://d.puremagic.com/issues/show_bug.cgi?id=6176
--- Comment #22 from Jonathan M Davis jmdavisp...@gmx.com 2012-01-18 13:50:26
PST ---
`if (x = foo())` can't work, so I don't know why `switch (x = foo())` can.
That's easy. With if, there's a strong possibility that the programmer really
http://d.puremagic.com/issues/show_bug.cgi?id=6176
--- Comment #23 from Stewart Gordon s...@iname.com 2012-01-18 15:26:46 PST ---
(In reply to comment #18)
What would it be anyway - just an optional check for the programmer
similar to the override attribute?
override will stop being
http://d.puremagic.com/issues/show_bug.cgi?id=6176
--- Comment #24 from bearophile_h...@eml.cc 2012-01-18 16:06:09 PST ---
(In reply to comment #23)
This wouldn't make sense - why should I be forced to add something just to
show
I know that all the case values are compile-time constants?
http://d.puremagic.com/issues/show_bug.cgi?id=6176
--- Comment #15 from d...@dawgfoto.de 2012-01-17 19:47:59 PST ---
Some argumentation in favor of a dynamic switch
switch (receive(ch0, ch1, ch2))
{
case ch0:
writeln(ch0.get());
break;
case ch1:
writeln(ch1.get());
break;
http://d.puremagic.com/issues/show_bug.cgi?id=6176
d...@dawgfoto.de changed:
What|Removed |Added
CC||d...@dawgfoto.de
--- Comment #10
http://d.puremagic.com/issues/show_bug.cgi?id=6176
Alex R�nne Petersen xtzgzo...@gmail.com changed:
What|Removed |Added
CC|
http://d.puremagic.com/issues/show_bug.cgi?id=6176
Peter Alexander peter.alexander...@gmail.com changed:
What|Removed |Added
CC|
http://d.puremagic.com/issues/show_bug.cgi?id=6176
--- Comment #13 from bearophile_h...@eml.cc 2012-01-15 11:11:43 PST ---
(In reply to comment #11)
I don't understand why anyone sees the need to limit the switch construct in
any way.
There are two very different use cases in D here. If you
http://d.puremagic.com/issues/show_bug.cgi?id=6176
Don clugd...@yahoo.com.au changed:
What|Removed |Added
CC||clugd...@yahoo.com.au
---
http://d.puremagic.com/issues/show_bug.cgi?id=6176
--- Comment #8 from Jonathan M Davis jmdavisp...@gmx.com 2011-07-08 01:13:14
PDT ---
Well, it works with variables which are of type int. TDPL claims that it works
with variables, and switch statements work with integral types and strings. So,
http://d.puremagic.com/issues/show_bug.cgi?id=6176
--- Comment #6 from Stewart Gordon s...@iname.com 2011-06-20 15:11:09 PDT ---
(In reply to comment #5)
(In reply to comment #4)
If the case values are all constant, create this tree.
Otherwise, just compare the switched value with the
http://d.puremagic.com/issues/show_bug.cgi?id=6176
Stewart Gordon s...@iname.com changed:
What|Removed |Added
Keywords|rejects-valid |spec
http://d.puremagic.com/issues/show_bug.cgi?id=6176
bearophile_h...@eml.cc changed:
What|Removed |Added
CC||bearophile_h...@eml.cc
---
http://d.puremagic.com/issues/show_bug.cgi?id=6176
Jonathan M Davis jmdavisp...@gmx.com changed:
What|Removed |Added
Keywords|spec|rejects-valid
http://d.puremagic.com/issues/show_bug.cgi?id=6176
Stewart Gordon s...@iname.com changed:
What|Removed |Added
Keywords||spec
--- Comment #4
http://d.puremagic.com/issues/show_bug.cgi?id=6176
--- Comment #5 from bearophile_h...@eml.cc 2011-06-19 16:23:49 PDT ---
(In reply to comment #4)
If the case values are all constant, create this tree. Otherwise, just
compare
the switched value with the cases individually.
This is
25 matches
Mail list logo