digitalmars.D.learn - Colons and brackets
- Etienne Cimon (11/11) Feb 27 2014 Hi all,
- evilrat (2/13) Feb 27 2014 add "version(all):" after code where specific version ends.
- anonymous (2/20) Feb 28 2014 nope
- Etienne (2/3) Mar 01 2014 nope?
- Etienne (2/5) Mar 01 2014 Can someone refute this anonymous nope?
- anonymous (8/12) Mar 01 2014 yep ;)
- evilrat (4/17) Mar 01 2014 of course it doesn't cancel it. it just re-enables code after
- evilrat (3/24) Mar 01 2014 oh. sorry, i remembere i have same problems with version:, back
- Etienne Cimon (6/10) Mar 02 2014 Brackets (braces) with "good practice" requires changing the indentation...
- Daniel Murphy (21/25) Mar 02 2014 This is incorrect, there is no way to do this.
Hi all, I'm a little perplexed b/c I can't seem to find anything that could tell me where this ends: version(something): code code code \eof How do you stop statements from belonging to the specific version of code without using brackets? Thanks!
Feb 27 2014
On Friday, 28 February 2014 at 04:19:47 UTC, Etienne Cimon wrote:Hi all, I'm a little perplexed b/c I can't seem to find anything that could tell me where this ends: version(something): code code code \eof How do you stop statements from belonging to the specific version of code without using brackets? Thanks!add "version(all):" after code where specific version ends.
Feb 27 2014
On Friday, 28 February 2014 at 04:31:03 UTC, evilrat wrote:On Friday, 28 February 2014 at 04:19:47 UTC, Etienne Cimon wrote:nopeHi all, I'm a little perplexed b/c I can't seem to find anything that could tell me where this ends: version(something): code code code \eof How do you stop statements from belonging to the specific version of code without using brackets? Thanks!add "version(all):" after code where specific version ends.
Feb 28 2014
On 2014-03-01 4:14 PM, Etienne wrote:On 2014-02-28 7:53 AM, anonymous wrote:Can someone refute this anonymous nope?nopenope?
Mar 01 2014
On Saturday, 1 March 2014 at 21:14:53 UTC, Etienne wrote:On 2014-02-28 7:53 AM, anonymous wrote:yep ;) The nope was directed at this statement specifically: On Friday, 28 February 2014 at 04:31:03 UTC, evilrat wrote:nopenope?add "version(all):" after code where specific version ends.I.e. "version(all):" doesn't cancel a former "version(foo):". There may or may not be a way to cancel a "version(foo):". I can't think of anything. Also, I don't see the problem with brackets.
Mar 01 2014
On Saturday, 1 March 2014 at 21:42:56 UTC, anonymous wrote:On Saturday, 1 March 2014 at 21:14:53 UTC, Etienne wrote:of course it doesn't cancel it. it just re-enables code after descending version operator. versions can only be enabled via compiler args or CTFE.On 2014-02-28 7:53 AM, anonymous wrote:yep ;) The nope was directed at this statement specifically: On Friday, 28 February 2014 at 04:31:03 UTC, evilrat wrote:nopenope?add "version(all):" after code where specific version ends.I.e. "version(all):" doesn't cancel a former "version(foo):". There may or may not be a way to cancel a "version(foo):". I can't think of anything. Also, I don't see the problem with brackets.
Mar 01 2014
On Sunday, 2 March 2014 at 05:23:21 UTC, evilrat wrote:On Saturday, 1 March 2014 at 21:42:56 UTC, anonymous wrote:oh. sorry, i remembere i have same problems with version:, back then i switched to brackets.On Saturday, 1 March 2014 at 21:14:53 UTC, Etienne wrote:of course it doesn't cancel it. it just re-enables code after descending version operator. versions can only be enabled via compiler args or CTFE.On 2014-02-28 7:53 AM, anonymous wrote:yep ;) The nope was directed at this statement specifically: On Friday, 28 February 2014 at 04:31:03 UTC, evilrat wrote:nopenope?add "version(all):" after code where specific version ends.I.e. "version(all):" doesn't cancel a former "version(foo):". There may or may not be a way to cancel a "version(foo):". I can't think of anything. Also, I don't see the problem with brackets.
Mar 01 2014
On 2014-03-01 16:42, anonymous wrote:I.e. "version(all):" doesn't cancel a former "version(foo):". There may or may not be a way to cancel a "version(foo):". I can't think of anything. Also, I don't see the problem with brackets.Brackets (braces) with "good practice" requires changing the indentation of everything in it :/ To keep it clean I decided to put the different sources in separate files and put the version clause near the import or with version (DEFINES): at the top of the page..
Mar 02 2014
"evilrat" wrote in message news:mxhmgkljrzqhaymeclvk forum.dlang.org... On Friday, 28 February 2014 at 04:19:47 UTC, Etienne Cimon wrote:This is incorrect, there is no way to do this. The compiler translates version(...): ... into version(...) { ... } So any version labels after the first are moved inside the first. You can see it with this code: version = y; version(x): pragma(msg, "versionx"); version(y): pragma(msg, "versiony"); Nothing is printed, because the version(y) block is inside the version(x) block, and version(x) is not set. The answer: use braces.How do you stop statements from belonging to the specific version of code without using brackets?add "version(all):" after code where specific version ends.
Mar 02 2014