Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64718 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56635 invoked from network); 9 Jan 2013 08:10:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Jan 2013 08:10:21 -0000 Authentication-Results: pb1.pair.com header.from=petercowburn@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=petercowburn@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.49 as permitted sender) X-PHP-List-Original-Sender: petercowburn@gmail.com X-Host-Fingerprint: 209.85.219.49 mail-oa0-f49.google.com Received: from [209.85.219.49] ([209.85.219.49:44594] helo=mail-oa0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2A/50-52225-CE52DE05 for ; Wed, 09 Jan 2013 03:10:21 -0500 Received: by mail-oa0-f49.google.com with SMTP id l10so688582oag.22 for ; Wed, 09 Jan 2013 00:10:18 -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=ov7eAOoPj5FYHrv6YwYjwEYqMC8X5AeJEu06QpCIUhg=; b=Kgklsw43IM3XleAt1tmmjLu02jRazElDy1agXlhxCvHmnAT+UVnfG31Tu3Qpg4BW3D LwDTQ/VXRBi4UzbYxEcciPPq+o4Irhk3YGuGr93m21wm17yezVTx7EYauwky+BY2OrWj p2bduN4GqiZr+JnOSQWis/TrwETTI9j4r7co+iCBjD6wKElnA2kdpVAUcpFx2WWXtMvx XxZexRXQp1nYcfmzbWqeUlt0M7Fs+iT/f8ecW8YXF2AmH41XFaYM4zXFQm6+NtJ3FyJq qHYtJ0AU2Jb2zZABPQNkVP8SE1w+mmMsDQYcYuzJMzCSxWjy3wlSo5rqAiv/ffgQ+Fku qWhA== Received: by 10.60.10.227 with SMTP id l3mr37419980oeb.119.1357719018156; Wed, 09 Jan 2013 00:10:18 -0800 (PST) MIME-Version: 1.0 Received: by 10.76.167.162 with HTTP; Wed, 9 Jan 2013 00:09:37 -0800 (PST) In-Reply-To: References: Date: Wed, 9 Jan 2013 08:09:37 +0000 Message-ID: To: Rasmus Schultz Cc: Vladislav Veselinov , internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] [RFC] Reflection annotations reader From: petercowburn@gmail.com (Peter Cowburn) 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. >> >>