digitalmars.D - private module declarations
- Tom (33/33) Aug 06 2006 I know this is not the first time this comes into the light but... I ins...
- Jarrett Billingsley (5/18) Aug 06 2006 I would absolutely love to see this. I mean, private module members alr...
- Derek Parnell (11/48) Aug 06 2006 Makes a lot of sense to me too.
- Sean Kelly (4/42) Aug 06 2006 I thought it already worked this way, as I use the technique quite a bit...
- kris (2/49) Aug 06 2006 Count me too;
- Dave (2/53) Aug 07 2006 Ditto.
- Chris Nicholson-Sauls (3/57) Aug 07 2006 Tritto. (Is that even a word?)
- Lars Ivar Igesund (6/63) Aug 07 2006 Quatro?
- Ivan Senji (3/46) Aug 07 2006 I knew it didn't work this way but use this technique in hope it will
- Graham St Jack (2/47) Aug 07 2006 I also thought it worked this way. I want it too.
- Oskar Linde (5/43) Aug 08 2006 I would too. I have already been coding like this with the assumption
- Bruno Medeiros (17/60) Aug 08 2006 Vote++
I know this is not the first time this comes into the light but... I insist. Actually (luckily), one can do the following: bar.d | class Bar {...whatever...} // Aux object foo.d | private import bar; // Private could be omitted | | class Foo {...whatever...} main.d | import foo; | | void main() | { | Foo f = new Foo; | Bar b = new Bar; // Error, private imported in foo.d | ... What are the difficulties of implementing in the language the following? foo.d | private class Bar {...whatever...} // Aux object | class Foo {...whatever...} main.d | import foo; | | void main() | { | Foo f = new Foo; | Bar b = new Bar; // Error, private member of foo.d | ... I would love to see this someday. Regards, -- Tom; "Some things have to be believed to be seen."
Aug 06 2006
"Tom" <ihate spam.com> wrote in message news:eb60uq$7eo$1 digitaldaemon.com...What are the difficulties of implementing in the language the following? foo.d | private class Bar {...whatever...} // Aux object | class Foo {...whatever...} main.d | import foo; | | void main() | { | Foo f = new Foo; | Bar b = new Bar; // Error, private member of foo.d | ... I would love to see this someday.I would absolutely love to see this. I mean, private module members already exist - but only for variables and functions. I've always wanted to be able to make aggregate types private to a module.
Aug 06 2006
On Sun, 06 Aug 2006 21:19:35 -0300, Tom wrote:I know this is not the first time this comes into the light but... I insist. Actually (luckily), one can do the following: bar.d | class Bar {...whatever...} // Aux object foo.d | private import bar; // Private could be omitted | | class Foo {...whatever...} main.d | import foo; | | void main() | { | Foo f = new Foo; | Bar b = new Bar; // Error, private imported in foo.d | ... What are the difficulties of implementing in the language the following? foo.d | private class Bar {...whatever...} // Aux object | class Foo {...whatever...} main.d | import foo; | | void main() | { | Foo f = new Foo; | Bar b = new Bar; // Error, private member of foo.d | ... I would love to see this someday.Makes a lot of sense to me too. What is fundamentally different about classes and structs, and every other type of declaration when it comes to visibility/accessibility? I'm sure this is a hang over from "the way C++ does it" mentality. -- Derek (skype: derek.j.parnell) Melbourne, Australia "Down with mediocrity!" 7/08/2006 1:08:40 PM
Aug 06 2006
Tom wrote:I know this is not the first time this comes into the light but... I insist. Actually (luckily), one can do the following: bar.d | class Bar {...whatever...} // Aux object foo.d | private import bar; // Private could be omitted | | class Foo {...whatever...} main.d | import foo; | | void main() | { | Foo f = new Foo; | Bar b = new Bar; // Error, private imported in foo.d | ... What are the difficulties of implementing in the language the following? foo.d | private class Bar {...whatever...} // Aux object | class Foo {...whatever...} main.d | import foo; | | void main() | { | Foo f = new Foo; | Bar b = new Bar; // Error, private member of foo.d | ... I would love to see this someday.I thought it already worked this way, as I use the technique quite a bit :-p Ah well, I vote for it too then. Sean
Aug 06 2006
Sean Kelly wrote:Tom wrote:Count me too;I know this is not the first time this comes into the light but... I insist. Actually (luckily), one can do the following: bar.d | class Bar {...whatever...} // Aux object foo.d | private import bar; // Private could be omitted | | class Foo {...whatever...} main.d | import foo; | | void main() | { | Foo f = new Foo; | Bar b = new Bar; // Error, private imported in foo.d | ... What are the difficulties of implementing in the language the following? foo.d | private class Bar {...whatever...} // Aux object | class Foo {...whatever...} main.d | import foo; | | void main() | { | Foo f = new Foo; | Bar b = new Bar; // Error, private member of foo.d | ... I would love to see this someday.I thought it already worked this way, as I use the technique quite a bit :-p Ah well, I vote for it too then. Sean
Aug 06 2006
kris wrote:Sean Kelly wrote:Ditto.Tom wrote:Count me too;I know this is not the first time this comes into the light but... I insist. Actually (luckily), one can do the following: bar.d | class Bar {...whatever...} // Aux object foo.d | private import bar; // Private could be omitted | | class Foo {...whatever...} main.d | import foo; | | void main() | { | Foo f = new Foo; | Bar b = new Bar; // Error, private imported in foo.d | ... What are the difficulties of implementing in the language the following? foo.d | private class Bar {...whatever...} // Aux object | class Foo {...whatever...} main.d | import foo; | | void main() | { | Foo f = new Foo; | Bar b = new Bar; // Error, private member of foo.d | ... I would love to see this someday.I thought it already worked this way, as I use the technique quite a bit :-p Ah well, I vote for it too then. Sean
Aug 07 2006
Dave wrote:kris wrote:Tritto. (Is that even a word?) -- Chris Nicholson-SaulsSean Kelly wrote:Ditto.Tom wrote:Count me too;I know this is not the first time this comes into the light but... I insist. Actually (luckily), one can do the following: bar.d | class Bar {...whatever...} // Aux object foo.d | private import bar; // Private could be omitted | | class Foo {...whatever...} main.d | import foo; | | void main() | { | Foo f = new Foo; | Bar b = new Bar; // Error, private imported in foo.d | ... What are the difficulties of implementing in the language the following? foo.d | private class Bar {...whatever...} // Aux object | class Foo {...whatever...} main.d | import foo; | | void main() | { | Foo f = new Foo; | Bar b = new Bar; // Error, private member of foo.d | ... I would love to see this someday.I thought it already worked this way, as I use the technique quite a bit :-p Ah well, I vote for it too then. Sean
Aug 07 2006
Chris Nicholson-Sauls wrote:Dave wrote:Quatro? -- Lars Ivar Igesund blog at http://larsivi.net DSource & #D: larsivikris wrote:Tritto. (Is that even a word?)Sean Kelly wrote:Ditto.Tom wrote:Count me too;I know this is not the first time this comes into the light but... I insist. Actually (luckily), one can do the following: bar.d | class Bar {...whatever...} // Aux object foo.d | private import bar; // Private could be omitted | | class Foo {...whatever...} main.d | import foo; | | void main() | { | Foo f = new Foo; | Bar b = new Bar; // Error, private imported in foo.d | ... What are the difficulties of implementing in the language the following? foo.d | private class Bar {...whatever...} // Aux object | class Foo {...whatever...} main.d | import foo; | | void main() | { | Foo f = new Foo; | Bar b = new Bar; // Error, private member of foo.d | ... I would love to see this someday.I thought it already worked this way, as I use the technique quite a bit :-p Ah well, I vote for it too then. Sean
Aug 07 2006
Sean Kelly wrote:Tom wrote:I knew it didn't work this way but use this technique in hope it will work one day.I know this is not the first time this comes into the light but... I insist. Actually (luckily), one can do the following: bar.d | class Bar {...whatever...} // Aux object foo.d | private import bar; // Private could be omitted | | class Foo {...whatever...} main.d | import foo; | | void main() | { | Foo f = new Foo; | Bar b = new Bar; // Error, private imported in foo.d | ... What are the difficulties of implementing in the language the following? foo.d | private class Bar {...whatever...} // Aux object | class Foo {...whatever...} main.d | import foo; | | void main() | { | Foo f = new Foo; | Bar b = new Bar; // Error, private member of foo.d | ... I would love to see this someday.I thought it already worked this way, as I use the technique quite a bit :-p Ah well, I vote for it too then.
Aug 07 2006
Sean Kelly wrote:Tom wrote:I also thought it worked this way. I want it too.I know this is not the first time this comes into the light but... I insist. Actually (luckily), one can do the following: bar.d | class Bar {...whatever...} // Aux object foo.d | private import bar; // Private could be omitted | | class Foo {...whatever...} main.d | import foo; | | void main() | { | Foo f = new Foo; | Bar b = new Bar; // Error, private imported in foo.d | ... What are the difficulties of implementing in the language the following? foo.d | private class Bar {...whatever...} // Aux object | class Foo {...whatever...} main.d | import foo; | | void main() | { | Foo f = new Foo; | Bar b = new Bar; // Error, private member of foo.d | ... I would love to see this someday.I thought it already worked this way, as I use the technique quite a bit :-p Ah well, I vote for it too then. Sean
Aug 07 2006
Tom wrote:I know this is not the first time this comes into the light but... I insist. Actually (luckily), one can do the following: bar.d | class Bar {...whatever...} // Aux object foo.d | private import bar; // Private could be omitted | | class Foo {...whatever...} main.d | import foo; | | void main() | { | Foo f = new Foo; | Bar b = new Bar; // Error, private imported in foo.d | ... What are the difficulties of implementing in the language the following? foo.d | private class Bar {...whatever...} // Aux object | class Foo {...whatever...} main.d | import foo; | | void main() | { | Foo f = new Foo; | Bar b = new Bar; // Error, private member of foo.d | ... I would love to see this someday.I would too. I have already been coding like this with the assumption that this is how it is going to work at some point in the future. It is after all the only thing that makes sense. /Oskar
Aug 08 2006
Tom wrote:I know this is not the first time this comes into the light but... I insist. Actually (luckily), one can do the following: bar.d | class Bar {...whatever...} // Aux object foo.d | private import bar; // Private could be omitted | | class Foo {...whatever...} main.d | import foo; | | void main() | { | Foo f = new Foo; | Bar b = new Bar; // Error, private imported in foo.d | ... What are the difficulties of implementing in the language the following? foo.d | private class Bar {...whatever...} // Aux object | class Foo {...whatever...} main.d | import foo; | | void main() | { | Foo f = new Foo; | Bar b = new Bar; // Error, private member of foo.d | ... I would love to see this someday. Regards, -- Tom; "Some things have to be believed to be seen."Vote++ And just to clarify, any kind of 'access' should be checked for protection attributes, including (but not limited to) : new Bar() Bar b; Bar.func() // fail even if func is accessible class Barbee : Bar { } template(T : Bar) { } template(alias A : Bar) { } alias Bar Baz; It may take a while to implement them all, so they don't have to be implemented all at once (and likely shouldn't), it's the first two or three that are the most important. -- Bruno Medeiros - MSc in CS/E student http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
Aug 08 2006