> - Consider introduction of static require() as class invariant for static > methods >
invariant contacts are executed in object methods. I meant adding "static invariant" to be executed on static methods. but I think we don't need them at this point. > > I probably don't understand the idea correctly. Could you give some > explanations? > > - Need to discuss syntax > > There were many ideas for possible syntaxes, I prefer current simple > syntax. > Syntax is not my priority. I don't mind require{assert();}, > return{assert();}, etc. > Since "error message" can be added and any expression is allowed, writing > contracts > as code may be better. We are better to avoid new keyword whenever it's > possible. > > - How to manage votes for 2 RFCs > > Both RFCs are large enough. How about make vote only RFC > https://wiki.php.net/rfc/dbc_vote > - Explain what is DbC. > - Choose "Introduce Native DbC for PHP - Yes or No" > - For people voted for Yes, "Annotation or Code" refer > links to https://wiki.php.net/rfc/dbc, https://wiki.php.net/rfc/dbc2 > - Choose "Annotation or Code" > > Sounds good. Alexander should provide one more proposal based on annotations or attributes. > > ==Annotation DbC Implementation== > Dmitry, I guess it wouldn't be too hard for you to implement this RFC. How > about annotation > version? Can it be implemented with reasonable amount of efforts? > any implementation of DbC is going to be not trivial... Thanks. Dmitry. > > > Thank you all those who are contributed discussion! > I hope you choose to have DbC support. DbC helps to achieve > "strict/precise development" > and "maximum performance in production" at the same time. > > Regards, > > P.S. It takes time to get used to new syntax. We may be better try to > expose new syntax > as much as possible. i.e. Put new syntax in mails whenever possible. > > Native DbC support syntax: > class Child { > require($this->age < 18); // Invariant (Class state condition) > > public function someMethod($input) > require(somethingAbout($input)) // Precondition > return($ret, somethingReturn($ret)) // Postcondition > { > /* Great! We are certain that caller satisfy precondition, return > appropriate return value and have proper class state! */ > } > } > > -- > Yasuo Ohgaki > yohg...@ohgaki.net > > >