Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82646 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18945 invoked from network); 13 Feb 2015 22:42:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Feb 2015 22:42:39 -0000 Authentication-Results: pb1.pair.com header.from=ralph@ralphschindler.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=ralph@ralphschindler.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain ralphschindler.com from 209.85.214.174 cause and error) X-PHP-List-Original-Sender: ralph@ralphschindler.com X-Host-Fingerprint: 209.85.214.174 mail-ob0-f174.google.com Received: from [209.85.214.174] ([209.85.214.174:46332] helo=mail-ob0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5F/70-15073-EDD7ED45 for ; Fri, 13 Feb 2015 17:42:39 -0500 Received: by mail-ob0-f174.google.com with SMTP id wo20so24892435obc.5 for ; Fri, 13 Feb 2015 14:42:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=BnOmJ5i5T3QRrfunkd151WvGri8oYhXb2pCWx+5u+Lc=; b=UH/pWct7vn/zmFnc7a9ODCH0X6aFQzerAFYUgJxLFfxPwkozpmmVTqXkTrmG1KnB1I 4eci7V+lwKk13LycFSuoGMmTEeIqElcFmWxkjh94lrOO4NZHomEF7NIpdWcEmV8QSUMx gdIU2iSSxrxumHHnWFclMRO4qKvGbJGsyB0HdLRDZZ3Xl1p+0pZ6kg+rH7FfBq0/9R5U 171pQgKmYUO78hJ6TWntQ65CNYJKeYha+dI8FA/M08jymNuwAp1d8gZlDBGY4K3SyODC cQxoY82H4wNmLzrGQJjXvVLg8XzFFmBWaems+taGwUiEyixv9rgJiDkhjRFc9kav/1N6 2rpg== X-Gm-Message-State: ALoCoQkGWmP+rChrZoYzSFnuY6SMMGal3pWF79Sl15y6TY9dAOpqwhSLbYCwp3N2VePBDqL03+5r X-Received: by 10.202.58.8 with SMTP id h8mr7587858oia.93.1423867355358; Fri, 13 Feb 2015 14:42:35 -0800 (PST) Received: from [172.16.1.4] (ip72-211-83-231.no.no.cox.net. [72.211.83.231]) by mx.google.com with ESMTPSA id dy9sm4745973obb.6.2015.02.13.14.42.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Feb 2015 14:42:34 -0800 (PST) Message-ID: <54DE7DD8.5060004@ralphschindler.com> Date: Fri, 13 Feb 2015 16:42:32 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV][RFC][VOTE] Group Use Declarations From: ralph@ralphschindler.com (Ralph Schindler) > > You could very well argue that this is what relative syntax is for: > > use PhpParser\NodeVisitorAbstract; > use PhpParser\Error; > use PhpParser\Node; > use PhpParser\Node\Stmt; > use PhpParser\Node\Expr; > > then foo(Expr\New_ $expr) > > That is even more readable and cleaner to read. +1 The current namespace implementation is there to group code, which is already does fairly successfully. I have to wonder if it is PHPStorm, IDE's and the like that have "encouraged" people to only _use_ class names instead of a particular part of a namespace (even if it is up to the last fragment of the namespace name). That is a behavior I'd like to see curtailed in the PHP community, b/c as Benjamin points out above, syntax that uses up to the last NS fragment is far more succinct. Question: If curly braces are used to mimic block syntax, is the semicolon also allowed? i.e: use PhpParser: NodeVisitorAbstract, Error, Node; use PhpParser\Node: Name, Name\FullyQualified; use PhpParser\Node\Stmt: Namespace_, Use_, Class_, Interface_, Trait_, Function_, Const_, Catch_, TraitUse, TraitUseAdaptation\Precedence; use PhpParser\Node\Expr: StaticCall, StaticPropertyFetch, ClassConstFetch, New_, Instanceof_, FuncCall, ConstFetch; Is this something that should be considered? -ralph