Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64757 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45195 invoked from network); 9 Jan 2013 16:29:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Jan 2013 16:29:57 -0000 Authentication-Results: pb1.pair.com smtp.mail=listas@rafaeldohms.com.br; spf=fail; sender-id=fail Authentication-Results: pb1.pair.com header.from=listas@rafaeldohms.com.br; sender-id=fail Received-SPF: fail (pb1.pair.com: domain rafaeldohms.com.br does not designate 74.125.82.47 as permitted sender) X-PHP-List-Original-Sender: listas@rafaeldohms.com.br X-Host-Fingerprint: 74.125.82.47 mail-wg0-f47.google.com Received: from [74.125.82.47] ([74.125.82.47:58900] helo=mail-wg0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 68/8E-02684-30B9DE05 for ; Wed, 09 Jan 2013 11:29:57 -0500 Received: by mail-wg0-f47.google.com with SMTP id dq11so1080060wgb.26 for ; Wed, 09 Jan 2013 08:29:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=fTJEwkUuqoNvM7+Pmg1XwA2EuLDwBk8FbuDJ1P/wkLQ=; b=XDnCRwpl6RwUequZJc2JYs7qBc4i6OO4wBzG4MKnAEJm5s7Qn8ChQ78hcsS6ahxowL 5HjBmbS6CQycNCCg7XLxDuD+TUF8Uf2KldCmkfpOSObViNjB5c6wxjgKACP2+uqfYNUs MDdbxm7h4XDD1vgwgzsGitqEEE9RkXrMn5HssXW5LyeSyHr7Tscoq1FGWK/ql34daoK0 DKwTbiH1b2/81NoXsx4LQ1MUyEWnB9a4zX0Rvuhzdu2sZg1NsnJrLdl1qCw9nAy3Y/38 XO36YAHWPdAAXM7sZDGdbsvzxjpbWT20E5jTXWJHJM0YJN3iwu5nkXEWOIUbIWZgad94 YAeQ== MIME-Version: 1.0 Received: by 10.194.78.236 with SMTP id e12mr53864990wjx.32.1357748992542; Wed, 09 Jan 2013 08:29:52 -0800 (PST) Received: by 10.194.46.234 with HTTP; Wed, 9 Jan 2013 08:29:52 -0800 (PST) In-Reply-To: <50ED98E4.7010009@garfieldtech.com> References: <50ED4C18.3090806@zerocue.com> <50ED98E4.7010009@garfieldtech.com> Date: Wed, 9 Jan 2013 17:29:52 +0100 Message-ID: To: Larry Garfield Cc: PHP internals Content-Type: multipart/alternative; boundary=047d7bf0d33065089e04d2dd92cd X-Gm-Message-State: ALoCoQmsz1HpcDPjPrYc4p4xgw3l8+510r9XSzL+L2Gx81uuDK3ZB+wUPss/TkF9NLQQzVmf6ZBr Subject: Re: [PHP-DEV] - True Annotations From: listas@rafaeldohms.com.br (Rafael Dohms) --047d7bf0d33065089e04d2dd92cd Content-Type: text/plain; charset=ISO-8859-1 On Wed, Jan 9, 2013 at 5:20 PM, Larry Garfield wrote: > On 1/9/13 9:31 AM, Levi Morrison wrote: > >> they are nearly syntactically identical to executable code. >>> >> >> "nearly" is the keyword there. They lack the ending semi-colon. Sure, >> this might mean PHP has to actually use an abstract syntax tree, but >> that's long overdue in my opinion. I know others disagree. This is >> only tangentially related, so I won't say more. >> > > Even if the parser is adjusted to cope with that, it's still an extremely > subtle difference for developers to keep track of. Consider the following > procedural snippets: > > @Foo[narf] > function something($narf) {} > > @Foo[narf]; > function something($narf) {} > > The first one says that $narf should pass @Foo validation. > > The second one says to call the function Foo with the string constant > "narf", and then define a function called something(). > > That's the sort of subtle bug that's just begging for someone to make an > honest typo and spend the next 6 hours tracking it down, until he realizes > what he did and proceeds to bang his head against his desk in frustration > for missing such a "simple" error. > > Let's not subsidize the headache drug manufacturers with PHP syntax > decisions. :-) > > --Larry Garfield > > I agree with the risks here. But i also really prefer a Token: approach then a [open token] [close token] approach Can we use a combination? like: @annot: Foo[narf] -- Rafael Dohms PHP Evangelist and Community Leader http://doh.ms http://wwwamsterdamphp.nl --047d7bf0d33065089e04d2dd92cd--