DIP 45 - approval discussion

Benjamin Thaut code at benjamin-thaut.de
Thu Nov 14 23:02:16 PST 2013


Am 15.11.2013 00:38, schrieb Rainer Schuetze:
>
> Maybe. Another rule might be that only the declarations actually
> annotated with "export" gets exported with the instantiation, so you
> could add "export" to the whole class or only some declaraations.
>

I don't think this is a good idea. It should be possible to put 
"export:" on top of a file and just export everything. If you limit it 
to decelerations the following would work:

export __gshared int g_var;

but the following wouldn't:

export __gshared int g_var = 0;

Although it would really produce equivalent code.

>
> compiling c and d as single files will silently generate different code,
> because when compiling d, the export alias is never seen.
>
> (this cannot happen with standard variables, only when declared multiple
> times, but differently, with extern(C/C++/System)).

And do you already have a idea how we could work around this problem?

Kind Regards
Benjamin Thaut


More information about the Digitalmars-d mailing list