module(system) Identifier;

bearophile bearophileHUGS at lycos.com
Sat Dec 13 12:52:45 PST 2008


The last changelog of D2:
http://www.digitalmars.com/d/2.0/changelog.html#new2_021

Says:
>Added -safe switch and module(system) Identifier; syntax.<

I am not sure that's the best solution.
A solution that I may like is a statement (that doesn't create a new scope, like the static if) like:

safe (...) {
}

That can be put anywhere in a module. Inside the (...) you can put a list of various things, like array bounds safety (currently -release), pointer safety (safeD), a possible future integer overflow safety, stack overflow safety, etc.

I don't know if that safe(){} syntax/semantics is good and doable. In TurboPascal/Delphi/FreePascal there's something similar, so it can be doable in D2 too.

If that syntax can't be used (for example because using a grain finer than the whole module level is too much difficult to implement) then I think something better than module(system) Identifier; can be invented still, that allows to choose what safety to keep in and what not :-)

Bye,
bearophile



More information about the Digitalmars-d mailing list