Jump to page: 1 2
Thread overview
private module declarations
Aug 07, 2006
Tom
Aug 07, 2006
Derek Parnell
Aug 07, 2006
Sean Kelly
Aug 07, 2006
kris
Aug 07, 2006
Dave
Aug 07, 2006
Lars Ivar Igesund
Aug 07, 2006
Ivan Senji
Aug 07, 2006
Graham St Jack
Aug 08, 2006
Oskar Linde
Aug 08, 2006
Bruno Medeiros
August 07, 2006
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."
August 07, 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.


August 07, 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
August 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 thought it already worked this way, as I use the technique quite a bit :-p  Ah well, I vote for it too then.


Sean
August 07, 2006
Sean Kelly wrote:
> 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


Count me too;
August 07, 2006
kris wrote:
> Sean Kelly wrote:
>> 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
> 
> 
> Count me too;

Ditto.
August 07, 2006
Dave wrote:
> kris wrote:
> 
>> Sean Kelly wrote:
>>
>>> 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
>>
>> Count me too;
> 
> Ditto.

Tritto.  (Is that even a word?)

-- Chris Nicholson-Sauls
August 07, 2006
Chris Nicholson-Sauls wrote:

> Dave wrote:
>> kris wrote:
>> 
>>> Sean Kelly wrote:
>>>
>>>> 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
>>>
>>> Count me too;
>> 
>> Ditto.
> 
> Tritto.  (Is that even a word?)

Quatro?

-- 
Lars Ivar Igesund
blog at http://larsivi.net
DSource & #D: larsivi
August 07, 2006
Sean Kelly wrote:
> 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.
> 

I knew it didn't work this way but use this technique in hope it will work one day.
August 07, 2006
Sean Kelly wrote:
> 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
I also thought it worked this way. I want it too.
« First   ‹ Prev
1 2