Re: Design by Contract

From: Date: Wed, 11 Feb 2015 19:05:37 +0000
Subject: Re: Design by Contract
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15  Groups: php.internals 
Request: Send a blank email to internals+get-82491@lists.php.net to get a copy of this message
Hi! > That one actually looks better to me, but: I'm not sure how annotation > syntax is supposed to support expressions or closures, > > > keep AST. So we'd have a zval type that is the raw AST? Would it also be available to user functions or internal functions/classes? It's an intriguing concept but I'm not sure we appreciate all the consequences of it - adding new type is a rather big change as everything should support it. Or did you mean something else? > Is it some special form of annotation for this > purpose only (meh)? > > > yes. some special attributes. requires/ensures/invariant Ah, so <<require()>> annotation would work different than any other type of annotation? Then I don't see any use for it to use annotation syntax (whatever it would be) - same syntax should mean same or at least similar function. Maybe I am still missing what you meant. > Oh, and <<>> syntax is *ugly* ;) > > > It's from HHVM. I don't like it as well, please, propose the better one. Pretty much every other one is better: Java and the followers, Python: @foo C#: [foo] -- Stas Malyshev smalyshev@gmail.com

« previous php.internals (#82491) next »