[dmd-internals] dmd commit, revision 649

Michel Fortin michel.fortin at michelf.com
Sun Aug 29 09:14:47 PDT 2010


Le 2010-08-29 à 9:59, Andrei Alexandrescu a écrit :

> Since scope is going to be deprecated, you may want to leave auto as is.

This makes me think. Couldn't "scope" be rebranded to mean "needs deterministic destruction" and become strictly an attribute for classes and structs?

This would offer a way out for bug 4621. "scope" applied on a struct or class would simply prevent it from being allocated in the GC-heap, or the absence of "scope" would restrict dereferencing members inside the destructor. Other uses for "scope" would be deprecated. It's embarrassing that the compiler happily compiles racy code such as the one found in bug 4624. (Andrei, that bug is about your code in Phobos by the way.)

bug 4621: http://d.puremagic.com/issues/show_bug.cgi?id=4621
bug 4624: http://d.puremagic.com/issues/show_bug.cgi?id=4624

-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/





More information about the dmd-internals mailing list