www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Re: DMD 1.025 and 2.009 releases

reply baaaam <nospam empty.com> writes:
1) is there any up to date documentation for the way const/invariant/enum works
now ?

2) whats the use for the enum manifest stuff since it renders it even
impossible to apply visibility attributes to const of that style. enum manifest
 consts are always "static public" as it seems..


Walter Bright Wrote:

 New const/invariant/enum in 2.009!
 
 http://www.digitalmars.com/d/1.0/changelog.html
 http://ftp.digitalmars.com/dmd.1.025.zip
 
 http://www.digitalmars.com/d/changelog.html
 http://ftp.digitalmars.com/dmd.2.009.zip

Jan 13 2008
parent reply Walter Bright <newshound1 digitalmars.com> writes:
baaaam wrote:
 1) is there any up to date documentation for the way
 const/invariant/enum works now ?

Yes, click the links on "enum" and "const" on the documentation pages.
 2) whats the use for the enum manifest stuff since it renders it even
 impossible to apply visibility attributes to const of that style.
 enum manifest  consts are always "static public" as it seems..

private enum i = 3;
Jan 13 2008
next sibling parent reply baaaam <nospam empty.com> writes:
Walter Bright Wrote:

 baaaam wrote:
 1) is there any up to date documentation for the way
 const/invariant/enum works now ?

Yes, click the links on "enum" and "const" on the documentation pages.

so did anything change in the behaviour of const/invaraiant ? "Both invariant and const are transitive, .." -> i thought this is not the case ? wasnt there too many problems with it ? i am confused and i guess i am not the only one.
 
 2) whats the use for the enum manifest stuff since it renders it even
 impossible to apply visibility attributes to const of that style.
 enum manifest  consts are always "static public" as it seems..

private enum i = 3;

this doesnt prevent anything from accessing that value of i. I testet it with dmd 2.009. struct Foo{ private enum i = 3; } every other piece of code can access i through "Foo.i" .
Jan 13 2008
parent baaaam <nospam empty.com> writes:
Moritz Warning Wrote:

 On Sun, 13 Jan 2008 06:17:25 -0500, baaaam wrote:
 "Both invariant and const are transitive, .." -> i thought this is not
 the case ? wasnt there too many problems with it ? i am confused and i
 guess i am not the only one.

"Both invariant and const are transitive, .." - that's right (for D2.00x).
 this doesnt prevent anything from accessing that value of i. I testet it
 with dmd 2.009.
 
 struct Foo{
  private enum i = 3;
 }
 
 every other piece of code can access i through "Foo.i" .

If you have two modules (= two files), they can't access each others private members.

right, thats exactly what i did and i was able to access that private member from another module. thats why i wondered, sounds like a bug huh ?
Jan 13 2008
prev sibling parent Moritz Warning <moritzwarning web_nospam_.de> writes:
On Sun, 13 Jan 2008 06:17:25 -0500, baaaam wrote:
 "Both invariant and const are transitive, .." -> i thought this is not
 the case ? wasnt there too many problems with it ? i am confused and i
 guess i am not the only one.

"Both invariant and const are transitive, .." - that's right (for D2.00x).
 this doesnt prevent anything from accessing that value of i. I testet it
 with dmd 2.009.
 
 struct Foo{
  private enum i = 3;
 }
 
 every other piece of code can access i through "Foo.i" .

If you have two modules (= two files), they can't access each others private members.
Jan 13 2008