Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64719 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58680 invoked from network); 9 Jan 2013 08:29:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Jan 2013 08:29:49 -0000 Authentication-Results: pb1.pair.com header.from=leight@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=leight@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.210.178 as permitted sender) X-PHP-List-Original-Sender: leight@gmail.com X-Host-Fingerprint: 209.85.210.178 mail-ia0-f178.google.com Received: from [209.85.210.178] ([209.85.210.178:43948] helo=mail-ia0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C9/B0-52225-C7A2DE05 for ; Wed, 09 Jan 2013 03:29:48 -0500 Received: by mail-ia0-f178.google.com with SMTP id k25so1211732iah.23 for ; Wed, 09 Jan 2013 00:29:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=UjzyHQWtusXY/ovQ2GduOfwcKsIEzHsDUj+LQcNItnk=; b=YbFjsY69IFZrq7aF9WOO8+hoCBTJl629bue77Grb8xNLmphSmv/zMfWvd0C9oaJvVg cR9LJDC8sFxL56T+oUJ0h77ZbUVa9LQYOu6do2bxU0y6HVyZL+Q7H1D5gKBQQKbg67Xo nMZVByZUdNs7Pi4EfOiC4IvyR4W/KcFIOa4P3YBQVM2NL2IU9lgKW53TJI7++OYYuh+C rpIsQnS31JnbopuixFw37olxtOqeftIV1ZqfVA3iDrGwZEWVjhvQu6p2CS/lsG+0KGkm 6NRbo2//pZuEOpn+6C9+hbwkgkIf7dyC5KRPCP2X0YSbSZZvDKZ6I9+YGqw0z1M9NVuy bHjg== MIME-Version: 1.0 X-Received: by 10.50.237.6 with SMTP id uy6mr717324igc.31.1357720185434; Wed, 09 Jan 2013 00:29:45 -0800 (PST) Received: by 10.64.127.136 with HTTP; Wed, 9 Jan 2013 00:29:45 -0800 (PST) In-Reply-To: References: Date: Wed, 9 Jan 2013 08:29:45 +0000 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=f46d0447850d5b73f504d2d6dd2f Subject: Re: [PHP-DEV] [RFC] Reflection annotations reader From: leight@gmail.com (Leigh) --f46d0447850d5b73f504d2d6dd2f Content-Type: text/plain; charset=ISO-8859-1 In my opinion (for however little it matters), code is code, and comments are comments. They should not mingle. Annotations, if implemented, should have their own syntax that makes them code, not an abstraction of a comment. I already dislike the fact that getDocComment is there - in my opinion all _comments_ should be discarded. That said, if people want to parse annotations from doc block comments, getDocComment _is_ already there and that is all they need to build a parser (imho). Annotations from doc blocks could quite easily be an extension building on top of getDocComment. I support annotations. As code, not comments. On 9 January 2013 08:09, Peter Cowburn wrote: > On 9 January 2013 01:08, Rasmus Schultz wrote: > > I've started working on a new proposal, but I'm getting hung up on the > > syntax - if we can't use angle brackets anymore, what can we use? > Virtually > > every symbol on a standard US keyword is an operator of some sort, does > > that mean those are all out of the question? > > > > e.g. thinking of concrete possible basic syntax, neither of the following > > delimiters would work: > > > > [Foo('bar')] > > Why would this not work? I'm struggling to think of a place where one > would want to use an annotation where it could be misinterpreted as an > array literal. If anything, the visual "conflict" or association with > the array syntax is a good thing in my book: my brain parses it as an > array of one or more annotations. > > > > > > > > > {Foo('bar')} > > > > And presumably none of the following would work either: > > > > ~Foo('bar') > > @Foo('bar') > > ^Foo('bar') > > *Foo('bar') > > &Foo('bar') > > :Foo('bar') > > > > Can you think of anything that would work? > > > > > > On Tue, Jan 8, 2013 at 3:57 AM, Vladislav Veselinov > > wrote: > > > >> Assume that you have this class with your proposed syntax: > >> > >> [SomeAnnotation('somevalue')] > >> class Test { > >> > >> } > >> > >> This conflicts with the short array syntax. It looks like an array > >> containing the result of the function 'SomeAnnotation' invoked with > >> the parameter 'somevalue'. > >> The only difference is the missing ";" but relying on this to > >> determine whether this is an annotation or not would be insane. > >> I'd support such a decision but with other syntax. > >> > >> I like Guilherme's RFC. I just don't think that the syntax is very > PHPish. > >> > >> > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --f46d0447850d5b73f504d2d6dd2f--