On 11/25/13 1:39 AM, ilya-stromberg wrote:
On Monday, 25 November 2013 at 04:35:10 UTC, Andrei Alexandrescu wrote:
On 11/24/13 8:27 PM, Craig Dillabaugh wrote:
Would it be possible to introduce a global scope of sorts that
had to be explicitly referenced when one wanted to define or use
a global variable. I haven't thought of how this might interface
with other D features, but something along the lines of:

@global int my_gobal_var; //Gets added to global scope.

//Then any globals would have to be referenced as:
global.my_global_var = 7;

Makes for a bit of extra typing, and would mess with any module
named 'global', but it might work?

To put it bluntly, many things are possible but it seems the best is
to do nothing here. We're in good shape.

I personally like Craig Dillabaugh's sugestion. But we can use `.`
operator for this because it alredy used for call global functions and,
probably, should break nothing. Like this:

int my_gobal_var;

.my_global_var = 7;

Is it possible?

Doesn't that work already?

Andrei

Reply via email to