Thread overview | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
August 28, 2003 Versioning | ||||
---|---|---|---|---|
| ||||
If I do this version(!SOMEVERSION) { foo(); } the compiler has error: identifier or integer expected, not ! shouldn't we be able to do that instead of: version(SOMEVERSION) {} else { foo(); } Same thing with debug. |
August 29, 2003 Re: Versioning | ||||
---|---|---|---|---|
| ||||
Posted in reply to Vathix | Yes. Am surprised we cannot. We should also be allowed to write version (Onething, Another, AndMore) { } else version (Different, Weirder) { } else { } Though I do not know whether we can or can't. Enlightenment needed ... :-) "Vathix" <vathix@dprogramming.com> wrote in message news:biknge$em4$1@digitaldaemon.com... > If I do this > version(!SOMEVERSION) { foo(); } > the compiler has error: identifier or integer expected, not ! > shouldn't we be able to do that instead of: > version(SOMEVERSION) {} else { foo(); } > Same thing with debug. > > > > |
August 29, 2003 Re: Versioning | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthew Wilson | Interesting, although I think it might be better using && and || operators. "Matthew Wilson" <matthew@stlsoft.org> wrote in message news:bink34$1sqv$1@digitaldaemon.com... > Yes. Am surprised we cannot. > > We should also be allowed to write > > version (Onething, Another, AndMore) > { > } > else version (Different, Weirder) > { > } > else > { > } > > Though I do not know whether we can or can't. Enlightenment needed ... :-) > > "Vathix" <vathix@dprogramming.com> wrote in message news:biknge$em4$1@digitaldaemon.com... > > If I do this > > version(!SOMEVERSION) { foo(); } > > the compiler has error: identifier or integer expected, not ! > > shouldn't we be able to do that instead of: > > version(SOMEVERSION) {} else { foo(); } > > Same thing with debug. > > > > > > > > > > |
August 29, 2003 Re: Versioning | ||||
---|---|---|---|---|
| ||||
Posted in reply to Vathix | "Vathix" <vathix@dprogramming.com> wrote in message news:binkfk$1t7m$1@digitaldaemon.com... > Interesting, although I think it might be better using && and || operators. Fair point > > > "Matthew Wilson" <matthew@stlsoft.org> wrote in message news:bink34$1sqv$1@digitaldaemon.com... > > Yes. Am surprised we cannot. > > > > We should also be allowed to write > > > > version (Onething, Another, AndMore) > > { > > } > > else version (Different, Weirder) > > { > > } > > else > > { > > } > > > > Though I do not know whether we can or can't. Enlightenment needed ... :-) > > > > "Vathix" <vathix@dprogramming.com> wrote in message news:biknge$em4$1@digitaldaemon.com... > > > If I do this > > > version(!SOMEVERSION) { foo(); } > > > the compiler has error: identifier or integer expected, not ! > > > shouldn't we be able to do that instead of: > > > version(SOMEVERSION) {} else { foo(); } > > > Same thing with debug. > > > > > > > > > > > > > > > > > > |
September 05, 2003 Re: Versioning | ||||
---|---|---|---|---|
| ||||
Posted in reply to Vathix | "Vathix" <vathix@dprogramming.com> wrote in message news:biknge$em4$1@digitaldaemon.com... > If I do this > version(!SOMEVERSION) { foo(); } > the compiler has error: identifier or integer expected, not ! > shouldn't we be able to do that instead of: > version(SOMEVERSION) {} else { foo(); } > Same thing with debug. It's a good question. What I was trying to do was avoid the C #ifdef mess, where it's nearly always the case that the layers of #if A && B && !C || D make little sense as separate versions, as it was built by layering of incomplete ideas. The idea is to decide exactly what of several versions are to be built, and build that one, not a mix of incomplete versions. |
September 06, 2003 Re: Versioning | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | You can't save people from themselves. ;) Sean "Walter" <walter@digitalmars.com> wrote in message news:bjb69g$2pks$1@digitaldaemon.com... > > "Vathix" <vathix@dprogramming.com> wrote in message news:biknge$em4$1@digitaldaemon.com... > > If I do this > > version(!SOMEVERSION) { foo(); } > > the compiler has error: identifier or integer expected, not ! > > shouldn't we be able to do that instead of: > > version(SOMEVERSION) {} else { foo(); } > > Same thing with debug. > > It's a good question. What I was trying to do was avoid the C #ifdef mess, where it's nearly always the case that the layers of #if A && B && !C || D make little sense as separate versions, as it was built by layering of incomplete ideas. The idea is to decide exactly what of several versions are > to be built, and build that one, not a mix of incomplete versions. |
September 06, 2003 Re: Versioning: debug | ||||
---|---|---|---|---|
| ||||
Posted in reply to Vathix | How about allowing debug by itself without parentheses so the code will be included if any type of debug is on, like assert. debug foo(); It looks like debug(0) does the trick but I don't think it's a standard. |
September 10, 2003 Re: Versioning: debug | ||||
---|---|---|---|---|
| ||||
Posted in reply to Vathix | "Vathix" <vathix@dprogramming.com> wrote in message news:bjdc8h$2ush$1@digitaldaemon.com... > How about allowing debug by itself without parentheses so the code will be included if any type of debug is on, like assert. > > debug foo(); > > It looks like debug(0) does the trick but I don't think it's a standard. The trouble is the ambiguity in the grammar to support both debug (0) expression and debug (expression). |
September 10, 2003 Re: Versioning: debug | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | "Walter" <walter@digitalmars.com> wrote in message news:bjmflf$1184$2@digitaldaemon.com... > > "Vathix" <vathix@dprogramming.com> wrote in message news:bjdc8h$2ush$1@digitaldaemon.com... > > How about allowing debug by itself without parentheses so the code will be > > included if any type of debug is on, like assert. > > > > debug foo(); > > > > It looks like debug(0) does the trick but I don't think it's a standard. > > The trouble is the ambiguity in the grammar to support both debug (0) > expression and debug (expression). > That's true, sorry. I'm fine with using debug(0) |
Copyright © 1999-2021 by the D Language Foundation