rfc:namespace-importing-with-from

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
rfc:namespace-importing-with-from [2012/07/24 15:13] – update reezerfc:namespace-importing-with-from [2017/09/22 13:28] (current) – external edit 127.0.0.1
Line 1: Line 1:
-====== Request for Comments: Enhance Namespace Importing With From Syntax ======+====== Request for Comments: Enhance Namespace Batch Importing Syntax ======
   * Version: 1.0   * Version: 1.0
   * Date: 2012-07-24   * Date: 2012-07-24
-  * Author: Reeze Xia <reeze.xia@gmail.com>+  * Author: Reeze Xia <reeze@php.net>
   * Status: Under Discussion   * Status: Under Discussion
   * First Published at: https://wiki.php.net/rfc/namespace-importing-with-from   * First Published at: https://wiki.php.net/rfc/namespace-importing-with-from
Line 8: Line 8:
 ===== Introduction ===== ===== Introduction =====
  
-This RFC proposes adding a new syntax <code php>from namespace use subnamespace as alias, sub_ns2sub3 as alias3;</code>+This RFC proposes adding a new syntax <code php>from TopNamespace use Subnamespace as alias, Subnamespace2Subnamespace3 as alias3;</code>
 This syntax is used to import multiple symbols from a common namespace cleanly. This syntax is used to import multiple symbols from a common namespace cleanly.
 It will make namespace importing easier and reduce deplication. It will make namespace importing easier and reduce deplication.
Line 19: Line 19:
 <code php> <code php>
 <?php <?php
-use Top\A\Long\Namespaced\ClassA+use GlobalNamespace\SubSpace\ThirdSpace\Class1
-use Top\A\Long\Namespaced\ClassB+use GlobalNamespace\SubSpace\ThirdSpace\Class2
-use Top\A\Long\Namespaced\ClassC;+use GlobalNamespace\SubSpace\ThirdSpace\ForthSpace\Class3;
 </code> </code>
  
Line 29: Line 29:
 <code php> <code php>
 <?php <?php
-from Top\A\Long\Namespaced\NS use ClassAClassBClassC;+from GlobalNamespace\SubSpace\ThirdSace use Class1Class2ForthSpace\Class3;
 </code> </code>
  
Line 152: Line 152:
  
 * 2012-07-24 Initially created by Reeze Xia * 2012-07-24 Initially created by Reeze Xia
- 
rfc/namespace-importing-with-from.1343142803.txt.gz · Last modified: 2017/09/22 13:28 (external edit)