Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82491 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64678 invoked from network); 11 Feb 2015 19:05:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Feb 2015 19:05:46 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.50 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.220.50 mail-pa0-f50.google.com Received: from [209.85.220.50] ([209.85.220.50:51466] helo=mail-pa0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BE/62-51722-808ABD45 for ; Wed, 11 Feb 2015 14:05:45 -0500 Received: by mail-pa0-f50.google.com with SMTP id hz1so5844054pad.9 for ; Wed, 11 Feb 2015 11:05:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=c+o9pg0X6whNTTOEugmAqtI2UPp4BKy65x5XyGjl+JY=; b=ZoLlSm4mbslQ1KRBgK1kvswWqgPfrLZ8/Pra1EXAfhdygM0nW4zip0kAWAWR5dGimV K71v2yWZbQrhOHCes8HlmcR00XFEgx2XFbDBW5x7rm65Tt/yE5CNMjUce28xwye43EkI JEThbHn9kQmXH3qoXfhM/9M3YEruFwJqKb1x6VpdjA2KoyqnMmvTg9+7wXvwK/bUxouG nHEAYcY5zltR61XlGppHZrGscO+xkkexQ2CBh/r5CDkpy0pnl7uzbawNRoj63/kfGbfG AvI8OSfkSucKgNGB5H50igjr4/mIv54dsJ71/XjCJ54BjHpX8CeJUPzrMWAWOAPc3Bh/ ielw== X-Received: by 10.68.226.198 with SMTP id ru6mr192491pbc.56.1423681541668; Wed, 11 Feb 2015 11:05:41 -0800 (PST) Received: from Stas-Air.local (108-66-6-48.lightspeed.sntcca.sbcglobal.net. [108.66.6.48]) by mx.google.com with ESMTPSA id ex1sm1544585pbc.80.2015.02.11.11.05.40 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Feb 2015 11:05:40 -0800 (PST) Message-ID: <54DBA801.8060403@gmail.com> Date: Wed, 11 Feb 2015 11:05:37 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Dmitry Stogov CC: Joe Watkins , Yasuo Ohgaki , =?UTF-8?B?RnJhbsOnb2lzIExhdXByZXRyZQ==?= , PHP Internals References: <54DAFD32.3000005@gmail.com> <54DB0BC0.20304@gmail.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Design by Contract From: smalyshev@gmail.com (Stanislav Malyshev) 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 <> 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