Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93090 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46603 invoked from network); 5 May 2016 15:00:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 May 2016 15:00:18 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.53 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.53 mail-wm0-f53.google.com Received: from [74.125.82.53] ([74.125.82.53:37651] helo=mail-wm0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E5/21-27079-1006B275 for ; Thu, 05 May 2016 11:00:18 -0400 Received: by mail-wm0-f53.google.com with SMTP id a17so32425551wme.0 for ; Thu, 05 May 2016 08:00:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=G2WzaLjy8ogFZlNsJE1YdK+LrQu9j3bBWM5nzpqitFY=; b=B65NIXNRMP7S5w3z2mMC1pofci2oU5N2K6ElgrJeGnjpcxEH0aUgOsgE/CTtg21xSC 2+Pn600IVjXFLbNQOfOKOmR9WbPc/GZihqCTH6DJXAoy3xM2v7vXGdGJRGp7+ajrIUgz sZHEiH+jaF69vyH0YJCaWdBvoS1ugo29zF4grNpCaiKjzRql/3P67WOsNObfTodL7ZLT AxGEv0hpceFQKe41aW0t7z17Up7yVyXK+IgMwXIF0gBb5SbpMfYFXqcuv9ux8zQuVUfz E9zmAPpDqjnSEuQXRuYR89KpHtzZEX7oqcy+JAnH+lbut9bb0zXbeGI+PaZumbV/b//n 0xLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=G2WzaLjy8ogFZlNsJE1YdK+LrQu9j3bBWM5nzpqitFY=; b=apMzG9B8o8NHsQBHPlFxTFd6b8S/v8jhqZlMZP2V5AaTH2KME36VO+c4Y/1O/Y/cMv spKXe8MenqQkUW6ynFGuH7gIN9N1nYS0WG7u4A6xykANdMfue9QgIlqSqbZQP54AFMnM 9DFdEP3vI9Ul42xhngzlt37iEdtZoSApRCGW/JGr+62q5lAyyumzw9AdeuxaPw7B5/fg iPMqgKMBcCQDXVtS3YL0RKEN5j4xrAH0W/d5WdQmPvnLx2s3Shw9b+nSlEt9OoJ9X8wl PCsc/WeBXaDsyF1kMzeWhoVIxfXfZOwuABtTo7LzBKU1gNwib+H2422jFbiNGX1RtY/J 4mcA== X-Gm-Message-State: AOPr4FXLjL4PyiJDhsbKM9L6ZVxPdKwX/AROWU+UH6yipfEwjYFSR6+zraoAlwHZJ8AcDg== X-Received: by 10.194.123.102 with SMTP id lz6mr15690628wjb.2.1462460414978; Thu, 05 May 2016 08:00:14 -0700 (PDT) Received: from [192.168.0.76] ([93.188.182.58]) by smtp.googlemail.com with ESMTPSA id ip10sm10164044wjb.33.2016.05.05.08.00.14 for (version=TLSv1/SSLv3 cipher=OTHER); Thu, 05 May 2016 08:00:14 -0700 (PDT) To: internals@lists.php.net References: <5723F2AE.2020806@garfieldtech.com> <8a7d1e8a-1e9e-0bbd-912a-21201638b989@gmail.com> <572B5781.4000403@garfieldtech.com> Message-ID: Date: Thu, 5 May 2016 15:58:20 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <572B5781.4000403@garfieldtech.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Attributes/Annotations Case Study: Drupal From: rowan.collins@gmail.com (Rowan Collins) Larry Garfield wrote on 05/05/2016 15:24: > <> Translator)>> > > <> > > <> > > I could easily see, for instance, Doctrine annotations building the > first, PHPUnit the second, and Zend the 3rd. Those would all be > legal-ish, but semantically very different. And there's also then no > guarantee that $foo >> Translator actually means a bit-shift (I don't > even know what a bitshift in that case would mean) To add some context to these examples: the first is borrowing the overload of ">>" from C++ (meaning "pass to stream") or similar uses in Ruby; the second the use of "|" as a pipe in templating languages like Smarty and Twig (meaning "pass expression to modifier function") or good old Unix shell tradition; and the third is inspired by PostgreSQL and imagines the operator overloaded to mean something like "matches the XPath-like expression given". I'm not sure any of those interpretations would actually be useful in the realm of annotations, but operator overloading is the first thing that sprung to mind when I wondered what a domain-specific language would look like if it were constrained only to producing a valid PHP AST. Another trick could be to abuse brackets, e.g. "something(anything)" will parse as a function call, but needn't be interpreted as one. Regards, -- Rowan Collins [IMSoP]