Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64733 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95157 invoked from network); 9 Jan 2013 12:13:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Jan 2013 12:13:46 -0000 Authentication-Results: pb1.pair.com smtp.mail=g.b.yahav@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=g.b.yahav@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.182 as permitted sender) X-PHP-List-Original-Sender: g.b.yahav@gmail.com X-Host-Fingerprint: 209.85.214.182 mail-ob0-f182.google.com Received: from [209.85.214.182] ([209.85.214.182:38158] helo=mail-ob0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D7/45-02684-AFE5DE05 for ; Wed, 09 Jan 2013 07:13:46 -0500 Received: by mail-ob0-f182.google.com with SMTP id 16so2092097obc.27 for ; Wed, 09 Jan 2013 04:13:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=0Z+BJbmRKS6wXEXxPvm6yCdwGV0Tt4bwq2pYI1gZras=; b=ayREkNGT4ORS+7m1xy10tZ6E2JJlSoB+e3JxYf1cTCf6sGuL3i2zO1/LEn6SRWH2Lk S5an3SCTEeTYpV8c8/h2Vn2DfSOlXo6jtm/S/xwgfyeaAC+za4kjHTa5ywxbd93ZEYvD bx+YcC6duIgXdvvR88k0hsoPiXrIvyrvaOjBrt+wuGzjGSVsEicEiLCLeDaXwOP4WlH4 WOxd4eAZooJUuahpaguSb/STyP/05F7VIZGjEl2vRju0oKmRGyZOBl/l7/roJXKKqMiV +x6Q0M5I4QM4TyZPhAwMlF+4vDgZo+iMqcchUS/VBoTD0/pG++pt6ACXWK/GCMlkni3a pstQ== Received: by 10.182.3.144 with SMTP id c16mr48768753obc.42.1357733624093; Wed, 09 Jan 2013 04:13:44 -0800 (PST) MIME-Version: 1.0 Received: by 10.76.151.4 with HTTP; Wed, 9 Jan 2013 04:13:23 -0800 (PST) In-Reply-To: References: <50ED4C18.3090806@zerocue.com> <9f792e7e11c481c5f4c62ce69ae216b6@mohiva.com> Date: Wed, 9 Jan 2013 14:13:23 +0200 Message-ID: To: Christian Kaps Cc: PHP internals Content-Type: multipart/alternative; boundary=f46d04447e015d1d7b04d2d9fe10 Subject: Re: [PHP-DEV] - True Annotations From: g.b.yahav@gmail.com (Yahav Gindi Bar) --f46d04447e015d1d7b04d2d9fe10 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Jan 9, 2013 at 2:09 PM, Christian Kaps wrote: > Am 09.01.2013 13:03, schrieb Yahav Gindi Bar: > >> On Wed, Jan 9, 2013 at 1:57 PM, Christian Kaps > >**wrote: >> >> Hi, >>> >>> >>> I agree here, I think the above, if possible would be best. In my >>> >>>> mind annotations should proabably be limited in scope to class >>>> declarations and thus only before a class keyword, before a property >>>> or method declaration. >>>> >>>> In none of those scopes would [ ] be a parsing issue I believe... >>>> >>>> The one case would be at the beginning of a class, but if simply >>>> added something such as: >>>> [:SomeAttribute(xyz,abc),****SomeAttribute2] >>>> >>>> >>>> It could never be confused with short array syntax and is still brief. >>>> >>>> >>> I think when implementing real annotations, then it should be possible to >>> declare arrays in it. So I think the square brackets don't work. >>> [Foo([1,2,3])] >>> >>> Cheers, >>> Christian >>> >>> -- >>> PHP Internals - PHP Runtime Development Mailing List >>> To unsubscribe, visit: http://www.php.net/unsub.php >>> >>> But the colon prefix won't cover this case? >>> >> >> You can, as I've mentioned in my post at the doc-block parser discussion, >> use a keyword inside the brackets to symbolize annotation, for example >> >> [metadata: Key] >> [metadata: MaxLength(10)] >> [metadata: Relations(["foo", "bar", "baz"])] >> public $id; >> > > Then rather [@Foo([1,2,3])] if it's possible! > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > Yeah, that's cool. To be honest, I took that idea from C# which has, for example (Quoted from standard template AssemblyInfo.cs): // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] --f46d04447e015d1d7b04d2d9fe10--