Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92696 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30373 invoked from network); 24 Apr 2016 16:03:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Apr 2016 16:03:12 -0000 Authentication-Results: pb1.pair.com header.from=danack@basereality.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=danack@basereality.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain basereality.com from 209.85.161.172 cause and error) X-PHP-List-Original-Sender: danack@basereality.com X-Host-Fingerprint: 209.85.161.172 mail-yw0-f172.google.com Received: from [209.85.161.172] ([209.85.161.172:34134] helo=mail-yw0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 30/B2-13951-E3EEC175 for ; Sun, 24 Apr 2016 12:03:11 -0400 Received: by mail-yw0-f172.google.com with SMTP id j74so146423317ywg.1 for ; Sun, 24 Apr 2016 09:03:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=basereality-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=sEYvj+4gsUq7LSBG1uNJQxNe5i+lvmiylRwFkThrL+U=; b=kYtYBRHfo66dE00p3ropypBPDRRLsU7aVyJs8WmSZtXtDj1KXzGEXwzUPfcmBvkLFf toxF9yCjxSNzn4BuT76mqxX4cckQFqSnrAR73DOtX/Qmb8uaeZN+X30gIZ98fdvk/GOC SryhwRJ4LAGY/tNLX9/ZUnpMlLp8UOtqWEOjcmIuLghmzjrm4CR1ZEsGe7tzEv2AsPD9 QT7d3mf4doaTonEOA8HCqdT8CJ+oWJhTCOGl7wNiV6DWaHNt9maSLbrMKiVdjAK1guaE w4qQgVBBWNIcNGJuDRTedcc6fOqa4KZj5rrzfr86nQJRu2RCABOyhib8CHWSaQ/iFobr kL2g== 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; bh=sEYvj+4gsUq7LSBG1uNJQxNe5i+lvmiylRwFkThrL+U=; b=Pq1Nvo1dO3tjWGURGLY0xFVp7SW/5tnkPURiV5mO3iZKYyrD3l8gY/Aw5UCEAudzQp m4zlnhpzPMj6F93S4qwSTeqAJhjOIhCFIJKiu7pl5PFSiXBLtFY4PBKpPbLAcyZwHNAY WHu/lqJasLDu67caHPLW3Ekz/M0aspz66Yow2j9z59U+UzXF2PVJrY45dJMVXijrzQjd Zdr7rBPfSIyL76rCN/FVPKkanh051v0gGd/l2v8ddr2kxOlFJUqUSzee0jqveRHn2e8h eMLidX9O9lecZNY6PNApHJpl+JztI04bWXjzo/ZyGCBSf7WGeuW2i2CxrtGiDX6TFQgy c4mg== X-Gm-Message-State: AOPr4FVTmm7Jd+53NmUf5VClEW2YSVgoQm3a58MR7vy1NfU872ru9c7TpxE+YYkFLokZ/vuUaDpEM66hpL6ppg== MIME-Version: 1.0 X-Received: by 10.37.19.67 with SMTP id 64mr18408166ybt.20.1461513788212; Sun, 24 Apr 2016 09:03:08 -0700 (PDT) Received: by 10.37.89.6 with HTTP; Sun, 24 Apr 2016 09:03:07 -0700 (PDT) X-Originating-IP: [2.99.227.0] In-Reply-To: References: Date: Sun, 24 Apr 2016 17:03:07 +0100 Message-ID: To: Dmitry Stogov Cc: internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] PHP Attributes From: danack@basereality.com (Dan Ackroyd) On 21 April 2016 at 22:13, Dmitry Stogov wrote: > Hi, > > > I would like to present an RFC proposing support for native annotation. > Hi Dmitry, Although everyone will have an opinion about the syntax, I think there is one criticism that should be thought about; the chosen syntax isn't future expandable to other concerns. People have talked about "design by contract" RFCs where annotation like data is readable by the engine. The current proposed syntax _could_ be used to store DBC data, but it would not be clear what would be annotation data to read by the application, and what was DBC data to be read by the engine. Changing the proposed syntax to be something like @attr(...) would allow it to be expanded in the future by adding a @contract(...) construct: @attr(test($a + $b > 0)) // This is attribute data read by userland code @contract(require($a + $b > 0, 'InvalidFooArgsException')) // This is DBC data read by the engine. function foo($a, $b) { ... } Making features be compatible with future features would avoid a lot of potential pain down the road. cheers Dan