Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
January 13, 2008 Re: DMD 1.025 and 2.009 releases | ||||
---|---|---|---|---|
| ||||
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
|
January 13, 2008 Re: DMD 1.025 and 2.009 releases | ||||
---|---|---|---|---|
| ||||
Posted in reply to baaaam | 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; |
January 13, 2008 Re: DMD 1.025 and 2.009 releases | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | 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" . |
January 13, 2008 Re: DMD 1.025 and 2.009 releases | ||||
---|---|---|---|---|
| ||||
Posted in reply to baaaam | 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" . private members are always accessible on the same module level. If you have two modules (= two files), they can't access each others private members. |
January 13, 2008 Re: DMD 1.025 and 2.009 releases | ||||
---|---|---|---|---|
| ||||
Posted in reply to Moritz Warning | 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" .
> private members are always accessible on the same module level.
> 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 ?
|
Copyright © 1999-2021 by the D Language Foundation