Re: Colons and brackets

2014-03-02 Thread Etienne Cimon

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..


Re: Colons and brackets

2014-03-02 Thread Daniel Murphy

"evilrat"  wrote in message news:mxhmgkljrzqhaymec...@forum.dlang.org...
On Friday, 28 February 2014 at 04:19:47 UTC, Etienne Cimon wrote:

>
> 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.


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. 



Re: Colons and brackets

2014-03-01 Thread evilrat

On Sunday, 2 March 2014 at 05:23:21 UTC, evilrat wrote:

On Saturday, 1 March 2014 at 21:42:56 UTC, anonymous wrote:

On Saturday, 1 March 2014 at 21:14:53 UTC, Etienne wrote:

On 2014-02-28 7:53 AM, anonymous wrote:

nope


nope?


yep ;)

The nope was directed at this statement specifically:

On Friday, 28 February 2014 at 04:31:03 UTC, evilrat wrote:

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.


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.


oh. sorry, i remembere i have same problems with version:, back 
then i switched to brackets.


Re: Colons and brackets

2014-03-01 Thread evilrat

On Saturday, 1 March 2014 at 21:42:56 UTC, anonymous wrote:

On Saturday, 1 March 2014 at 21:14:53 UTC, Etienne wrote:

On 2014-02-28 7:53 AM, anonymous wrote:

nope


nope?


yep ;)

The nope was directed at this statement specifically:

On Friday, 28 February 2014 at 04:31:03 UTC, evilrat wrote:

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.


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.


Re: Colons and brackets

2014-03-01 Thread anonymous

On Saturday, 1 March 2014 at 21:14:53 UTC, Etienne wrote:

On 2014-02-28 7:53 AM, anonymous wrote:

nope


nope?


yep ;)

The nope was directed at this statement specifically:

On Friday, 28 February 2014 at 04:31:03 UTC, evilrat wrote:

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.


Re: Colons and brackets

2014-03-01 Thread Etienne

On 2014-03-01 4:14 PM, Etienne wrote:

On 2014-02-28 7:53 AM, anonymous wrote:

nope


nope?


Can someone refute this anonymous nope?


Re: Colons and brackets

2014-03-01 Thread Etienne

On 2014-02-28 7:53 AM, anonymous wrote:

nope


nope?


Re: Colons and brackets

2014-02-28 Thread anonymous

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:

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.


nope


Re: Colons and brackets

2014-02-27 Thread evilrat

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.


Colons and brackets

2014-02-27 Thread Etienne Cimon

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!