Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82516 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32072 invoked from network); 12 Feb 2015 07:38:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Feb 2015 07:38:33 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.220.177 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.177 mail-vc0-f177.google.com Received: from [209.85.220.177] ([209.85.220.177:55182] helo=mail-vc0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BC/62-13750-8785CD45 for ; Thu, 12 Feb 2015 02:38:33 -0500 Received: by mail-vc0-f177.google.com with SMTP id hy10so3042075vcb.8 for ; Wed, 11 Feb 2015 23:38:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=7HxlerSjIzGbV2XftIRWrpmKe3RaY5WiN5yCo9o7qFo=; b=XT9LMMnneX01RV9vpk1fJBqP89wseAF46Xqw3FG4xcZSVDVZkNDf2W3SwAa/P3k0zz mW0TSyC3dLln1TMnXAePjDfEg/ek7JoZE0PnEQWXzUyDwOsrhHD3h/q4xF16ebAYHIFJ +G/ncNNNUTr4tG35wlMLEqhaazvQqdJMHXktfeodZvn3a9zTgL7lXqLwc5quRcYR6F26 vLhOkQgidSu08sxVQLqzOOy7aD1fvu/aUIVjTsf10DY05ma7k9iONVat1oEUd2OmIEXI DMolYOxLyvoKxG9NMQDbcscWkNkw8AYp8apSXKqHeNpwYY/l5vSD14bA4y0ECudHhdG0 i8JA== X-Gm-Message-State: ALoCoQlWIi7is4hO25mOp+TZ3RXS0Y4h0Ve9t/YW0P/Xu96Eg+C19AoEnVF8gNVXIfu37JC3l6qfvPQ7bAmNdBsr9CCbYw8ScIJUfq7rjI+rBKIRAPJKE2OYI4TnhSucj7dhcpmZheYyGLWEAZc/Rei9MfsnOo6O6w== MIME-Version: 1.0 X-Received: by 10.52.26.18 with SMTP id h18mr1454214vdg.51.1423726709651; Wed, 11 Feb 2015 23:38:29 -0800 (PST) Received: by 10.52.74.73 with HTTP; Wed, 11 Feb 2015 23:38:29 -0800 (PST) In-Reply-To: <54DBA801.8060403@gmail.com> References: <54DAFD32.3000005@gmail.com> <54DB0BC0.20304@gmail.com> <54DBA801.8060403@gmail.com> Date: Thu, 12 Feb 2015 11:38:29 +0400 Message-ID: To: Stanislav Malyshev Cc: Joe Watkins , Yasuo Ohgaki , =?UTF-8?Q?Fran=C3=A7ois_Laupretre?= , PHP Internals Content-Type: multipart/alternative; boundary=20cf307d0076c98692050edf349b Subject: Re: [PHP-DEV] Design by Contract From: dmitry@zend.com (Dmitry Stogov) --20cf307d0076c98692050edf349b Content-Type: text/plain; charset=UTF-8 Hi, On Wed, Feb 11, 2015 at 10:05 PM, Stanislav Malyshev wrote: > 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? > This is just an initial idea, and some research is required. I don't propose to add new ZVAL type. AST may be just stored internally and accesses through extended Reflection API. This API may provide some classes to represent AST nodes. > > Is it some special form of annotation for this > > purpose only (meh)? > > > > > > yes. some special attributes. requires/ensures/invariant > > Ah, so <> 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. > I don't understand you as well. It should be clear, that annotation should allow declaration of any attributes, and some of them may be used for different purposes. some for DbC. > > > 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] > [foo] is already a legal syntax in PHP - array with constant foo. Thanks. Dmitry. > > -- > Stas Malyshev > smalyshev@gmail.com > --20cf307d0076c98692050edf349b--