private module declarations

Chris Nicholson-Sauls ibisbasenji at gmail.com
Mon Aug 7 06:51:42 PDT 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



More information about the Digitalmars-d mailing list