A little of coordination for Rosettacode

bearophile bearophileHUGS at lycos.com
Tue Mar 5 05:12:47 PST 2013


Jos van Uden:

>> // this shouldn't happen
>>
>> test.d
>>
>> import simdb;

If I try to compile something like that my dmd gives me a 
duplicated main error, or something similar.


> I really mean:
>
> test.d
>  void fun() {
>      auto db = load();
>      // etc
>      store(db);
> }
>
> simdb.d
>
> import test;
>
> fun();

Do you mean that the load and store functions are "private" and 
should only be called by other functions in the module? (If this 
is true, then it's enough to mark as module-private those two 
functions).

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list