Shared with no type in Druntime.

Jacob Carlborg doob at me.com
Sun Apr 29 08:21:10 PDT 2012


On 2012-04-29 05:03, Adam Wilson wrote:

> Ok, I can accept that. Explicit typing is lots of extra pointless typing
> when the compiler can just figure it out for me. But that leaves us with
> an interesting design question. Right now, DI gen is destructive, which
> means any changes I make to the DI file will get destroyed on the next
> build if I forget to remove the -H flags. Unfortunately that means that
> the DI generator is going to have to somewhat dictate coding style and
> we need to make sure that DI gen covers the broadest possible range of
> potential uses.
>
> Personally, I have no problem leaving in initializers for module level
> variables. Is that an acceptable solution to the community?

No, I think it's way better that the DI generator outputs the actually 
type instead of just "shared/auto" and the assignment.

In this case:

shared stdin = &_iob[0];

Should be generated as:

shared File stdin;

Anything to the right of the assignment operator is just an 
implementation detail.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list