Hi Stas,
I agree, it may look weird at first, but if you familiar with concept it
looks more or less natural. It's implemented in D, Effiel, it was a
proposal for Java, etc
Anyway, we will have at least 3 competing proposals.
1) contracts in doc-commetns https://wiki.php.net/rfc/dbc
/**
* @requires ($a >= 0)
*/
function foo($a) {
}
2) contracts as part of the language https://wiki.php.net/rfc/dbc2
function foo($a)
require($a >= 0)
{
}
3) contracts in annotations
<<requires($a >= 0)>>
function foo($a) {
}
The fact that we are working on (2) now, doesn't mean we will select it as
a final solution. (3) is an interesting option as well.
Thanks. Dmitry.
On Wed, Feb 11, 2015 at 9:56 AM, Stanislav Malyshev <[email protected]>
wrote:
> Hi!
>
> > Please steer clear of using the assert API, and in so doing avoid BC
> > concerns with the current assert API.
>
> The operator can be called something other than "assert", I'm sure the
> thesaurus has a lot of possibilities.
>
> > Please avoid adding a magic method and use the suggested syntax for
> > invariant.
> >
> > class Some {
> > require(invariant-expr);
>
> I think reusing syntax for existing operator in completely unrelated
> context is a big mistake. Having code outside of functions is probably
> not the best idea too.
>
> --
> Stas Malyshev
> [email protected]
>