digitalmars.D - Some things to fix
- Ary Borenszweig (5/5) Jul 30 2009 1. private applied to structs, classes, etc., doesn't have any effect: I...
- Steven Schveighoffer (7/12) Jul 30 2009 1 is not a problem unless you are in the same file. Any classes/functio...
- Ary Borenszweig (11/25) Jul 30 2009 That's exactly what I'm saying.
- Steven Schveighoffer (6/31) Jul 30 2009 Oh, I read private applied to struct/class *members* sorry...
- Ary Borenszweig (9/48) Jul 30 2009 There are several now about protection attributes not working as expecte...
- Jesse Phillips (2/11) Jul 30 2009 Added these to: http://d.puremagic.com/issues/show_bug.cgi?id=3108
- Trass3r (4/5) Jul 30 2009 That bug annoys me since 3 years!
- Robert Fraser (6/7) Jul 30 2009 There's been wars about this one. IMO, this is a good thing for writing
- Sjoerd van Leent (15/24) Jul 31 2009 I disagree, what about:
- Sergey Gromov (10/38) Jul 31 2009 Even better:
1. private applied to structs, classes, etc., doesn't have any effect: I can access them anyway. 2. modifiers that don't make sense should be disallowed. I think these are pretty serious bugs (specially the first one). Why new features are added to D and these things are not getting fixed?
Jul 30 2009
On Thu, 30 Jul 2009 12:04:54 -0400, Ary Borenszweig <ary esperanto.org.ar> wrote:1. private applied to structs, classes, etc., doesn't have any effect: I can access them anyway. 2. modifiers that don't make sense should be disallowed. I think these are pretty serious bugs (specially the first one). Why new features are added to D and these things are not getting fixed?1 is not a problem unless you are in the same file. Any classes/functions compiled in the same module are considered to be part of the same module of code, and therefore have access to eachothers private data. Try accessing same private fields from outside the module. -Steve
Jul 30 2009
Steven Schveighoffer wrote:On Thu, 30 Jul 2009 12:04:54 -0400, Ary Borenszweig <ary esperanto.org.ar> wrote:That's exactly what I'm saying. --- module one; private struct Foo {} --- module two; import one; Foo foo; --- Compiles without errors.1. private applied to structs, classes, etc., doesn't have any effect: I can access them anyway. 2. modifiers that don't make sense should be disallowed. I think these are pretty serious bugs (specially the first one). Why new features are added to D and these things are not getting fixed?1 is not a problem unless you are in the same file. Any classes/functions compiled in the same module are considered to be part of the same module of code, and therefore have access to eachothers private data. Try accessing same private fields from outside the module.
Jul 30 2009
On Thu, 30 Jul 2009 12:17:53 -0400, Ary Borenszweig <ary esperanto.org.ar> wrote:Steven Schveighoffer wrote:Oh, I read private applied to struct/class *members* sorry... I agree private classes/structs should work. I'm sure there's a bugzilla for it already. -SteveOn Thu, 30 Jul 2009 12:04:54 -0400, Ary Borenszweig <ary esperanto.org.ar> wrote:That's exactly what I'm saying. --- module one; private struct Foo {} --- module two; import one; Foo foo; --- Compiles without errors.1. private applied to structs, classes, etc., doesn't have any effect: I can access them anyway. 2. modifiers that don't make sense should be disallowed. I think these are pretty serious bugs (specially the first one). Why new features are added to D and these things are not getting fixed?1 is not a problem unless you are in the same file. Any classes/functions compiled in the same module are considered to be part of the same module of code, and therefore have access to eachothers private data. Try accessing same private fields from outside the module.
Jul 30 2009
Steven Schveighoffer wrote:On Thu, 30 Jul 2009 12:17:53 -0400, Ary Borenszweig <ary esperanto.org.ar> wrote:Yeah, I didn't write "from other modules", so I wasn't clear enough.Steven Schveighoffer wrote:Oh, I read private applied to struct/class *members* sorry...On Thu, 30 Jul 2009 12:04:54 -0400, Ary Borenszweig <ary esperanto.org.ar> wrote:That's exactly what I'm saying. --- module one; private struct Foo {} --- module two; import one; Foo foo; --- Compiles without errors.1. private applied to structs, classes, etc., doesn't have any effect: I can access them anyway. 2. modifiers that don't make sense should be disallowed. I think these are pretty serious bugs (specially the first one). Why new features are added to D and these things are not getting fixed?1 is not a problem unless you are in the same file. Any classes/functions compiled in the same module are considered to be part of the same module of code, and therefore have access to eachothers private data. Try accessing same private fields from outside the module.I agree private classes/structs should work. I'm sure there's a bugzilla for it already.There are several now about protection attributes not working as expected: http://d.puremagic.com/issues/show_bug.cgi?id=1161 http://d.puremagic.com/issues/show_bug.cgi?id=1567 http://d.puremagic.com/issues/show_bug.cgi?id=2225 http://d.puremagic.com/issues/show_bug.cgi?id=2830 http://d.puremagic.com/issues/show_bug.cgi?id=313 http://d.puremagic.com/issues/show_bug.cgi?id=314
Jul 30 2009
Ary Borenszweig Wrote:There are several now about protection attributes not working as expected: http://d.puremagic.com/issues/show_bug.cgi?id=1161 http://d.puremagic.com/issues/show_bug.cgi?id=1567 http://d.puremagic.com/issues/show_bug.cgi?id=2225 http://d.puremagic.com/issues/show_bug.cgi?id=2830 http://d.puremagic.com/issues/show_bug.cgi?id=313 http://d.puremagic.com/issues/show_bug.cgi?id=314Added these to: http://d.puremagic.com/issues/show_bug.cgi?id=3108
Jul 30 2009
Ary Borenszweig schrieb:http://d.puremagic.com/issues/show_bug.cgi?id=314That bug annoys me since 3 years! It seems like it has been (at least partly) fixed in LDC, that guy even posted the changesets...
Jul 30 2009
Ary Borenszweig wrote:2. modifiers that don't make sense should be disallowed.There's been wars about this one. IMO, this is a good thing for writing templated/generic code -- if a modifier only makes sense in one instance of a template, all the others should not be marked as errors. I think _conflicting_ modifiers should be made an error, i.e. "public private int x;".
Jul 30 2009
Robert Fraser Wrote:Ary Borenszweig wrote:I disagree, what about: public { . . . private { } . . . } Perhaps a warning in obvious cases (public private) should be raised.2. modifiers that don't make sense should be disallowed.There's been wars about this one. IMO, this is a good thing for writing templated/generic code -- if a modifier only makes sense in one instance of a template, all the others should not be marked as errors. I think _conflicting_ modifiers should be made an error, i.e. "public private int x;".
Jul 31 2009
Fri, 31 Jul 2009 04:57:23 -0400, Sjoerd van Leent wrote:Robert Fraser Wrote:Even better: public: . . . private: . . .Ary Borenszweig wrote:I disagree, what about: public { . . . private { } . . . } Perhaps a warning in obvious cases (public private) should be raised.2. modifiers that don't make sense should be disallowed.There's been wars about this one. IMO, this is a good thing for writing templated/generic code -- if a modifier only makes sense in one instance of a template, all the others should not be marked as errors. I think _conflicting_ modifiers should be made an error, i.e. "public private int x;".
Jul 31 2009