Version bug?

Andrej Mitrovic andrej.mitrovich at gmail.com
Fri Aug 20 18:29:38 PDT 2010


I dunno, TDPL says:

"D does not have a global scope or a global namespace. In particular,
there is no way to define a truly global object, function, or class
name. This is because the only way to define such an entity is to put
it in a module, and any module has a name. In turn, the name of the
module introduces a named scope."

On Sat, Aug 21, 2010 at 3:08 AM, Adam Ruppe <destructionator at gmail.com> wrote:
> On 8/20/10, Andrej Mitrovic <andrej.mitrovich at gmail.com> wrote:
>> There are no global variables in D, afaik. But I haven't studied this
>> closely yet.
>
> The opposite: there are multiple  kinds. You have enums in the global
> scope, which are available to everyone, but don't take any storage
> (that's what I used here), you have regular globals, which are
> available to everyone, but in thread local storage, and you have real
> global variables which are available to everyone and you are on your
> own, like in C.
>
> enum int compileTimeGlobal;
> int threadLocalGlobal;
> __gshared int realGlobalLikeInC;
>


More information about the Digitalmars-d mailing list