Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92360 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16999 invoked from network); 16 Apr 2016 01:38:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Apr 2016 01:38:29 -0000 Authentication-Results: pb1.pair.com header.from=cornelius.howl@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=cornelius.howl@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.50 as permitted sender) X-PHP-List-Original-Sender: cornelius.howl@gmail.com X-Host-Fingerprint: 209.85.218.50 mail-oi0-f50.google.com Received: from [209.85.218.50] ([209.85.218.50:36341] helo=mail-oi0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 34/AE-29891-39791175 for ; Fri, 15 Apr 2016 21:38:27 -0400 Received: by mail-oi0-f50.google.com with SMTP id y204so140514054oie.3 for ; Fri, 15 Apr 2016 18:38:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=ssjC2NIHhnGMrZDeQk9ANNj6sx7q8+8zrZRd3ZHU8lE=; b=mxJtxg2dpbKXhqall1fZcNcVLsNAMk9nXnUc8CnS3lc8d92XWYe8U5A8kj8mWI5mQb MGiptWVjvxlbSyoPzNZz7tARbDYaMCf8zahxzj6SiqTBbTAb05Du3zL7WsMkBTo5bkjg my6fWTw41ekqxZBa9br/H785CwbbyT1yPOzx627u6dKC05JVCvsXJqwQh+3RqKfZGRCv /I2fwYD2BbzL2WJ8AWAV5GYqCuLND7s6Kcb9nxqogXyyG6azBeJtUZ7kavkPjyCbPEz5 UvpSdTJ1IxHbc+XUbsEA/GykuwjrBEmqwgqcXcQLuVRzT3t1B2JbmOhfhBrK8cmyLCzp o5QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=ssjC2NIHhnGMrZDeQk9ANNj6sx7q8+8zrZRd3ZHU8lE=; b=OkZ1zdcIylRgHeEUt2U9jtpwlkKJRH/VHT6E8dLrE303TZvlMMsVbwrOTMbVpxjhfJ gEs04oFv1flDX0aNt5k12xtvSf36yLpFJKdWonsJiPiQLmmuf7D8AZ6C5mga/ZDGNRu+ a82VaF9ve4Y7mViFAKjkxFSJTNMt3/mDnsWRSzRf/TLG0FQAuRfjYhIDIYxgyeIkr95p ZW/9NNphZ7ZTjPdhUGKKBO9Kwu6d3S07/5nxdWdctVgGbkOXNm0Hx9YiYsvCAGdVrQVD LM5KrAg9wTFazD/M6sMFnc7jcYNwMj2mlJ/n7YwC6YdY/qlx9jIFRSmALS++qfi7fcCs rC3g== X-Gm-Message-State: AOPr4FVXt5CBQtl4xftjGNlr0Es0pPgqhcIlCmY3WYvsrtk6pX18xF/1Z05rjPEiKhYhlR7rGXkEKloWER+ARw== MIME-Version: 1.0 X-Received: by 10.202.54.212 with SMTP id d203mr11714452oia.23.1460770704242; Fri, 15 Apr 2016 18:38:24 -0700 (PDT) Received: by 10.157.7.194 with HTTP; Fri, 15 Apr 2016 18:38:24 -0700 (PDT) In-Reply-To: References: Date: Sat, 16 Apr 2016 09:38:24 +0800 Message-ID: To: "guilhermeblanco@gmail.com" Cc: PHP internals Content-Type: multipart/alternative; boundary=001a113cd3feecc02d0530902ec6 Subject: Re: [PHP-DEV] Trying to fix "use" language inconsistencies From: cornelius.howl@gmail.com (Lin Yo-An) --001a113cd3feecc02d0530902ec6 Content-Type: text/plain; charset=UTF-8 I thought there was one already? https://wiki.php.net/rfc/group_use_declarations On Sat, Apr 16, 2016 at 9:01 AM, guilhermeblanco@gmail.com < guilhermeblanco@gmail.com> wrote: > Hi internals, > > > It all started with a PR over doctrine/annotations ( > https://github.com/doctrine/annotations/pull/69), where a contributor > decided to propose supporting group use support. > > The issue starts with this, which it is perfectly supported: > > use Foo\Bar, Foo\Woo; > > While multiple group uses are not: > > use Foo\{Bar, Baz}, Qux\{Corge, Grault}; > > Then I decided to see what is really supported by the newly introduced > group use. According to the grammar, these are the same lines: > > use Foo\Bar, Foo\Baz; > use Foo\{Bar, Baz}; > > use function Foo\Bar\baz, Foo\Bar\qux; > use function Foo\Bar\{baz, qux}; > use Foo\Bar\{function baz, function qux}; > > However, this feature leads to an inconsistent behavior in the language. > Mixed group use types are supported: > > use Foo\Bar\{Baz, function qux}; > > While mixing use types are not: > > use Foo\Bar\Baz, function Foo\Bar\qux; > > > This brings the question of whether we should continue this madness path of > inconsistency or we start addressing inconsistencies one by one in the > language. > I'd like to propose options that we could fix this: > > - Remove mixed group use types support (this would become invalid: use > Foo\{Bar, function baz};) > - Add mixed use support, which would contradict the approach took by typed > properties (this would require this approach: use function Foo\Bar\baz, > function Foo\Bar\qux;) > > One of the approaches needs to be taken in order to support multiple group > use, otherwise we have a reduce/reduce yacc error that can't be fixed > (well, my yacc/compiler's knowledge hit a dead end there, without doubling > all the grammar rules and taking an overly complex route). Ultimately, the > question comes around if we should consider support of multiple group use. > If positive, I'd suggest approach two (I already have a patch for that! > =D). > > > I'd like to gather opinions around this, so I can properly implement and > propose a patch through an RFC process. > > > Regards, > > -- > Guilherme Blanco > Lead Architect at E-Block > -- Best Regards, Yo-An Lin --001a113cd3feecc02d0530902ec6--