On Tuesday, 5 March 2013 at 13:12:49 UTC, bearophile wrote:
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.

Sorry, that was a wrong example.

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).

Yes, but I think it would be best to put a private modifier
around the entire code, except main.

private {
  ...
}

Reply via email to