Proposal for Deimos documentation
Jens Mueller
jens.k.mueller at gmx.de
Fri Mar 22 03:53:59 PDT 2013
Jacob Carlborg wrote:
> On 2013-03-22 09:33, Jens Mueller wrote:
>
> >Skipping (bool, ...) is covered by "at most one", isn't it? Do you have
> >an example where one C include results in several D imports?
>
> // a.h
> int a;
>
> // b.h
> #include <a.h>
>
> // main.c
> #include <b.h>
>
> int main (int c, char** v) { a = 3; }
>
> The above should work. If you translate that code to D and only
> replaces the include with one import you won't have access to the
> "a" variable.
True. But shouldn't you fix those things as follows:
module deimos.a;
int a;
(BTW Probably we should add shared here?)
module deimos.b;
public import deimos.a; // shouldn't this fix the problem
Does this work?
Should I add text about when to use public imports?
Jens
More information about the Digitalmars-d
mailing list