digitalmars.D - version(D_Version2)
- Derek Parnell (16/16) Mar 12 2008 I just want to lodge a formal complaint.
- Bill Baxter (4/24) Mar 12 2008 It could solve your problem too. :-)
- Derek Parnell (9/13) Mar 12 2008 I have no idea what that means.
- Alexander Panek (2/15) Mar 12 2008 Preprocessing, probably?
- Gregor Richards (4/20) Mar 12 2008 Yeah, this is the "simple" way of using the C preprocessor with any
- JMNorris (17/24) Mar 12 2008 Maybe someone should write a preprocessor for D, as horrifying as the
- Gregor Richards (6/34) Mar 12 2008 I've considered adding preproc support to DSSS for situations like this
- Scott S. McCoy (3/25) Mar 12 2008 You could always just call cpp(1) directly.
- Bill Baxter (7/10) Mar 13 2008 I wondered if that was the case, but in my cygwin terminal
- Bill Baxter (13/25) Mar 12 2008 It's what the others said.
I just want to lodge a formal complaint. The implementation of version(D_Version2) that insists that code in its scope must be valid version 1 (one) code is a true PITA. <rant rating="venomous"> Almost without exception, I'm finding that I have to use the string mixin idiom. Using that idiom excessively is bad coding form, IMNSHO. Having to constantly use version(D_Version2) { mixin(` ... version 2 specific code ... `); } is NOT A GOOD SIGN !!!! </rant> -- Derek Parnell Melbourne, Australia skype: derek.j.parnell
Mar 12 2008
Derek Parnell wrote:I just want to lodge a formal complaint. The implementation of version(D_Version2) that insists that code in its scope must be valid version 1 (one) code is a true PITA. <rant rating="venomous"> Almost without exception, I'm finding that I have to use the string mixin idiom. Using that idiom excessively is bad coding form, IMNSHO. Having to constantly use version(D_Version2) { mixin(` ... version 2 specific code ... `); } is NOT A GOOD SIGN !!!! </rant>I just resorted to this in something I was doing the other day:dmd file.dIt could solve your problem too. :-) --bb
Mar 12 2008
On Wed, 12 Mar 2008 17:56:49 +0900, Bill Baxter wrote:I just resorted to this in something I was doing the other day: > dmd file.dI have no idea what that means. I don't use gcc and I run D in a Windows environment. I use Linux daily at the office because that's I develop software for (but not in C/C++) so I understand the 'sed' part is, but what's gcc doing? -- Derek Parnell Melbourne, Australia skype: derek.j.parnell
Mar 12 2008
Derek Parnell wrote:On Wed, 12 Mar 2008 17:56:49 +0900, Bill Baxter wrote:Preprocessing, probably?I just resorted to this in something I was doing the other day: > dmd file.dI have no idea what that means. I don't use gcc and I run D in a Windows environment. I use Linux daily at the office because that's I develop software for (but not in C/C++) so I understand the 'sed' part is, but what's gcc doing?
Mar 12 2008
Alexander Panek wrote:Derek Parnell wrote:Yeah, this is the "simple" way of using the C preprocessor with any language. - Gregor RichardsOn Wed, 12 Mar 2008 17:56:49 +0900, Bill Baxter wrote:Preprocessing, probably?I just resorted to this in something I was doing the other day: > dmd file.dI have no idea what that means. I don't use gcc and I run D in a Windows environment. I use Linux daily at the office because that's I develop software for (but not in C/C++) so I understand the 'sed' part is, but what's gcc doing?
Mar 12 2008
Gregor Richards <Richards codu.org> wrote in news:47D8017C.6000003 codu.org:Alexander Panek wrote:Maybe someone should write a preprocessor for D, as horrifying as the thought may be to some. It should: 1. Be usable only for conditional compilation. No constants allowed outside preprocessing directives and no pseudo-function macros at all. 2. (Perhaps) work on *.dpp files and generate *.d files. D's conditional compilation works fine *except* across versions with varying syntaxes (such as D1 and D2). If D becomes popular enough to support multiple competing commercial compilers, then compiler-specific syntax extensions, syntax bugs, and other syntax hiccups will exacerbate the problem. We can keep within 98% of the spirit of Walter's (and mine, for that matter) anti-preprocessing bias by keeping defines and D code absolutely segregated. -- JMNorrisPreprocessing, probably?Yeah, this is the "simple" way of using the C preprocessor with any language. - Gregor Richards
Mar 12 2008
JMNorris wrote:Gregor Richards <Richards codu.org> wrote in news:47D8017C.6000003 codu.org:I've considered adding preproc support to DSSS for situations like this one, but I also have the anti-preprocessing bias, and I'm afraid of what the backlash might be like. Still, there are rare situations (e.g. this one) where preprocessing is hard to avoid. - Gregor RichardsAlexander Panek wrote:Maybe someone should write a preprocessor for D, as horrifying as the thought may be to some. It should: 1. Be usable only for conditional compilation. No constants allowed outside preprocessing directives and no pseudo-function macros at all. 2. (Perhaps) work on *.dpp files and generate *.d files. D's conditional compilation works fine *except* across versions with varying syntaxes (such as D1 and D2). If D becomes popular enough to support multiple competing commercial compilers, then compiler-specific syntax extensions, syntax bugs, and other syntax hiccups will exacerbate the problem. We can keep within 98% of the spirit of Walter's (and mine, for that matter) anti-preprocessing bias by keeping defines and D code absolutely segregated.Preprocessing, probably?Yeah, this is the "simple" way of using the C preprocessor with any language. - Gregor Richards
Mar 12 2008
You could always just call cpp(1) directly. I do this with various excessively for awk. On Wed, 2008-03-12 at 09:14 -0700, Gregor Richards wrote:Alexander Panek wrote:Derek Parnell wrote:Yeah, this is the "simple" way of using the C preprocessor with any language. - Gregor RichardsOn Wed, 12 Mar 2008 17:56:49 +0900, Bill Baxter wrote:Preprocessing, probably?I just resorted to this in something I was doing the other day: > dmd file.dI have no idea what that means. I don't use gcc and I run D in a Windows environment. I use Linux daily at the office because that's I develop software for (but not in C/C++) so I understand the 'sed' part is, but what's gcc doing?
Mar 12 2008
Scott S. McCoy wrote:You could always just call cpp(1) directly. I do this with various excessively for awk.I wondered if that was the case, but in my cygwin terminal cpp --help gave me the help for gcc. At that point I just decided calling gcc -E was less likely to be problematic. --bb
Mar 13 2008
Derek Parnell wrote:On Wed, 12 Mar 2008 17:56:49 +0900, Bill Baxter wrote:It's what the others said. gcc -E just runs the preprocessor -C says to keep the comments instead of stripping them -xc says to pretend the following file is C code despite the extension. The preprocessor spits out line directives like In D those are supposed to be #line 1 "somefile" So the sed thing makes that change. The regexp there is pretty dumb, though. Really I guess you need a parser that can understand quoted strings to do the job 100% properly. But it was enough for my case. --bbI just resorted to this in something I was doing the other day: > dmd file.dI have no idea what that means. I don't use gcc and I run D in a Windows environment. I use Linux daily at the office because that's I develop software for (but not in C/C++) so I understand the 'sed' part is, but what's gcc doing?
Mar 12 2008