assert() vs. enforce(), invariant() vs. ... ?

Andrej Mitrovic andrej.mitrovich at gmail.com
Sat Aug 31 02:46:09 PDT 2013


On 8/30/13, Andrei Alexandrescu <SeeWebsiteForEmail at erdani.org> wrote:
> * typedef: it was so ill defined, bringing it any closer to sanity
> would've broken someone's code.

So it had to be properly defined in the spec and implemented.
Meanwhile we're fighting with the Phobos Typedef and it has way more
problems right now, some of which will likely be unsolvable. Bug
reports:

http://d.puremagic.com/issues/show_bug.cgi?id=10872
http://d.puremagic.com/issues/show_bug.cgi?id=10871
http://d.puremagic.com/issues/show_bug.cgi?id=10778
http://d.puremagic.com/issues/show_bug.cgi?id=8618
http://d.puremagic.com/issues/show_bug.cgi?id=7777
http://d.puremagic.com/issues/show_bug.cgi?id=7737

> * scope: cute and dangerous in equal proportions - great for a movie
> character, terrible for language design.

scoped() has its own quirks, for example:
http://d.puremagic.com/issues/show_bug.cgi?id=4636
http://d.puremagic.com/issues/show_bug.cgi?id=5115
http://d.puremagic.com/issues/show_bug.cgi?id=10921

And this last bug that was filed (10921) was a bug that was known since 2010:
http://d.puremagic.com/issues/show_bug.cgi?id=5115#c6

So 3 years later, and it's still an issue. I don't even see how Issue
4636 can even be fixed, there's no way for a template in another
module to get private access to the class constructor.

---

Anyway, we've deprecated old keywords, and introduced half-implemented
library replacements. I don't see how we stand any better today than
we did before.


More information about the Digitalmars-d mailing list