Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92413 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29676 invoked from network); 18 Apr 2016 15:06:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Apr 2016 15:06:57 -0000 Authentication-Results: pb1.pair.com header.from=guilhermeblanco@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=guilhermeblanco@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.172 as permitted sender) X-PHP-List-Original-Sender: guilhermeblanco@gmail.com X-Host-Fingerprint: 209.85.223.172 mail-io0-f172.google.com Received: from [209.85.223.172] ([209.85.223.172:32992] helo=mail-io0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 38/08-11975-018F4175 for ; Mon, 18 Apr 2016 11:06:57 -0400 Received: by mail-io0-f172.google.com with SMTP id o126so197454152iod.0 for ; Mon, 18 Apr 2016 08:06:56 -0700 (PDT) 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; bh=EUvTjIALYotVp2zkNc90zGyZ0dh7fkSPG3pM4ANMlcE=; b=u08wwGRfBQ2tD9AOz/fdEf2ZLl41qowQM0AHeVdBDkRht5zkinOHdqSX2/+pto7oc2 PVccZajqtVcxcyTaS37ls3nVizZc2WUIQOnBVlQUs0R1pGUdLJec/hMb24d2TvgpDoXM tgBlvM/yN7Lf/LaWz9cD5mfWX9orX9yP1rwSLMBaTAfwdy9nXmbV+KJmkV3yZxhI5Kve 3euvBvQEgKgjfmiumOgGwPEH3b+SePRzjidp7U+z65t2uuBjk7pIwXY28nZLMj8QuQ5X 9d5mNazzqbsARfvjX1wPnCptTy2QxAWQgxlG2C8kBQH9o99UKcdtHPYW7ATVsHsa7bf/ BvIQ== 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:from:date :message-id:subject:to:cc; bh=EUvTjIALYotVp2zkNc90zGyZ0dh7fkSPG3pM4ANMlcE=; b=ZfHDrIbNTexvKsud3VaipqvbfSrH+u+d99SkbmvQlDCZYn7Lr5LMXC6nOceNETqDup fww1fFZXr/1NsgV8kZTkJq5afoOFmhroAP8L9/rEQpVeNWOcrK9IapeVk6hMmJr5SsN4 TZXd8i0P6zGOBJ/SHVFXYRCLn30vILi9di4tjc9sJu69sdY7P0Wgz+C6XO/C2iTnet26 rr+X3xZzm1u8WsNee5D+M1i0PXEZwJBxI4KVme3BlhY9mrX1zOzPeIR/K9B3lag94f6S QVpD+caoChBDePJPomG7rnvFhle2ncvVuZ/76KmhmZOrHq5ugjI7W6VMH7uh+le/IFMv Mv7A== X-Gm-Message-State: AOPr4FXSD+AYumKqF497sXJn3arLVM7N/OvrwACB0fBoG87jz+6xPz+0FhZsOxWhaFbGRj/V06dm0AVctjx2XA== X-Received: by 10.107.148.210 with SMTP id w201mr37666093iod.63.1460992013607; Mon, 18 Apr 2016 08:06:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.85.10 with HTTP; Mon, 18 Apr 2016 08:06:34 -0700 (PDT) In-Reply-To: References: Date: Mon, 18 Apr 2016 11:06:34 -0400 Message-ID: To: Lin Yo-An Cc: PHP internals Content-Type: multipart/alternative; boundary=001a113fd402fdad990530c3b5ba Subject: Re: [PHP-DEV] Trying to fix "use" language inconsistencies From: guilhermeblanco@gmail.com ("guilhermeblanco@gmail.com") --001a113fd402fdad990530c3b5ba Content-Type: text/plain; charset=UTF-8 You missed what I said. You can do multiple single class/function/constant in a single statement, but you cannot do multiple group use in a single statement. This: use Foo\Bar, Foo\Baz\{Qux, Corge}; Regards, On Fri, Apr 15, 2016 at 9:38 PM, Lin Yo-An wrote: > 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 > -- Guilherme Blanco Lead Architect at E-Block --001a113fd402fdad990530c3b5ba--