No subject


Mon Aug 11 21:20:09 PDT 2008


What is disallowed is global _state_ only.
regarding your goto example:
I agree that there are rare cases where unsafe features can be helpful
like goto statements. I like the D approach of being a practical
language and not force a religion on you. contrast that with Java where
goto is a reserved word specifically so you won't be able to use it.
however, I'd like to see a way to mark those features and separate them
from the regular safe code.
I'm thinking about something like "unsafe" blocks from C#. This way, all
those dirty tricks are available to you and you can use them if, for
example, you just need to do a quick'n'dirty short script. However,
those dirty trick will be marked as such in large code-bases and would
be handled appropriately.
Also, the compiler could have a "safe" flag to disallow those features
and issue errors/warnings with info about lack of safety.
for example, static state breaks multi threaded code and all such state
should be either marked as thread local or synchronized. marking this as
"unsafe" will warn the programmer about such implications.


More information about the Digitalmars-d-announce mailing list