Re: case statements

2009-10-10 Thread Ellery Newcomer
Christopher Wright wrote: > Ellery Newcomer wrote: >> Jarrett Billingsley wrote: >>> On Sat, Oct 10, 2009 at 8:45 PM, Ellery Newcomer >>> wrote: This is probably a bad idea >>> A single string mixin must consist of an entire, fully-formed >>> statement, expression, or declaration (depending o

Re: case statements

2009-10-10 Thread Christopher Wright
Ellery Newcomer wrote: Jarrett Billingsley wrote: On Sat, Oct 10, 2009 at 8:45 PM, Ellery Newcomer wrote: This is probably a bad idea A single string mixin must consist of an entire, fully-formed statement, expression, or declaration (depending on where it's used). Case labels do not, on thei

Re: case statements

2009-10-10 Thread Ellery Newcomer
Jarrett Billingsley wrote: > On Sat, Oct 10, 2009 at 8:45 PM, Ellery Newcomer > wrote: >> This is probably a bad idea > > A single string mixin must consist of an entire, fully-formed > statement, expression, or declaration (depending on where it's used). > Case labels do not, on their own, count

Re: case statements

2009-10-10 Thread Jarrett Billingsley
On Sat, Oct 10, 2009 at 8:45 PM, Ellery Newcomer wrote: > This is probably a bad idea, but from my readings of the dmd source, I > noticed some preprocessor defines that looked useful, along the lines of > > #define CASES case A:case B: (etc) > > I'd kinda like something similar in D, but a naive

Re: case statements

2009-10-10 Thread Jeremie Pelletier
Ellery Newcomer wrote: This is probably a bad idea, but from my readings of the dmd source, I noticed some preprocessor defines that looked useful, along the lines of #define CASES case A:case B: (etc) I'd kinda like something similar in D, but a naive attempt with mixins doesn't work, e.g. im

case statements

2009-10-10 Thread Ellery Newcomer
This is probably a bad idea, but from my readings of the dmd source, I noticed some preprocessor defines that looked useful, along the lines of #define CASES case A:case B: (etc) I'd kinda like something similar in D, but a naive attempt with mixins doesn't work, e.g. immutable string cases = "c

Re: How about macro == symbol for mixin statement? [was Re: Member functions C to D]

2009-10-10 Thread Yigal Chripun
On 10/10/2009 10:50, Don wrote: Yigal Chripun wrote: On 10/10/2009 00:36, Christopher Wright wrote: Yigal Chripun wrote: On 09/10/2009 00:38, Christopher Wright wrote: It makes macros highly compiler-specific, or requires the compiler's AST to be part of the language. Nemerle took the nuclea

Re: How about macro == symbol for mixin statement? [was Re: Member functions C to D]

2009-10-10 Thread Christopher Wright
Yigal Chripun wrote: On 10/10/2009 00:36, Christopher Wright wrote: Yigal Chripun wrote: On 09/10/2009 00:38, Christopher Wright wrote: It makes macros highly compiler-specific, or requires the compiler's AST to be part of the language. Nemerle took the nuclear option, and its macros are all

Re: How about macro == symbol for mixin statement? [was Re: Member functions C to D]

2009-10-10 Thread Don
Yigal Chripun wrote: On 10/10/2009 00:36, Christopher Wright wrote: Yigal Chripun wrote: On 09/10/2009 00:38, Christopher Wright wrote: It makes macros highly compiler-specific, or requires the compiler's AST to be part of the language. Nemerle took the nuclear option, and its macros are all

Re: How about macro == symbol for mixin statement? [was Re: Member functions C to D]

2009-10-10 Thread Yigal Chripun
On 10/10/2009 00:36, Christopher Wright wrote: Yigal Chripun wrote: On 09/10/2009 00:38, Christopher Wright wrote: It makes macros highly compiler-specific, or requires the compiler's AST to be part of the language. Nemerle took the nuclear option, and its macros are all-powerful. That's a rea