Am 10.02.2015 08:08 schrieb "Yasuo Ohgaki" <yohg...@ohgaki.net>: > > One reason I would like to use __invariant() is to allow overriding parents. > I think we should have way for it, but I don't have good idea now. > I'm still thinking.
Hmm, Idea... Imagine the require keyword, in the context of classes, as an alternative to the function keyword. One could write any of these: class foo { require (expr); // like anonymous function. nonoverridable static require (expr); // same for nonmethod calls // _named_ form require something (expr); // overrides static require otherthing (expr); // overrides } This way selective overriding would be possible for individual conditions. The namespace for these invariant expression names could / should be wholly separate from the method namespace itself. best regards Patrick