Re: [PHP-DEV] 回复: [PHP-DEV] Re: 回复: [PHP-DEV] [RFC] Proposal namespace importing with from syntax

2012-07-24 Thread Laruence
On Wed, Jul 25, 2012 at 2:54 PM, Leigh wrote: > What about expanding the syntax instead of introducing new reserved words. > > use A\B { > Class1, > Class2 > } better than from :). and a little consistent with use traits in class thanks -- Laruence Xinchen Hui http://www.laruence.com/

[PHP-DEV] Re: 回复: [PHP-DEV] Re: 回复: [PHP-DEV] [RFC] Proposal namespace importing with from syntax

2012-07-24 Thread Laruence
On Wed, Jul 25, 2012 at 2:43 PM, Reeze Xia wrote: > Hi, > > 在 2012年7月25日星期三,下午1:27,Laruence 写道: > > Hi: > > is there any really usage? I didn't see before. I don't think every > > Yes, eg: > https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/EntityRepository.php#L24 > > it could be

Re: [PHP-DEV] 回复: [PHP-DEV] Re: 回复: [PHP-DEV] [RFC] Proposal namespace importing with from syntax

2012-07-24 Thread Leigh
What about expanding the syntax instead of introducing new reserved words. use A\B { Class1, Class2 }

[PHP-DEV] 回复: [PHP-DEV] Re: 回复: [PHP-DEV] [RFC] Proposal namespace importing with from syntax

2012-07-24 Thread Reeze Xia
Hi, 在 2012年7月25日星期三,下午1:27,Laruence 写道: > Hi: > > is there any really usage? I didn't see before. I don't think every Yes, eg: https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/EntityRepository.php#L24 it could be: from Doctrine\Common\Collections use ExpressionBuilder, Cri

Re: [PHP-DEV] Re: 回复: [PHP-DEV] [RFC] Proposal namespace importing with from syntax

2012-07-24 Thread Laruence
Hi: is there any really usage? I didn't see before. I don't think every python feature is proper for PHP. PHP is not python. -1 on this RFC +1 for Stas and one more thing, BC break. there are many ORM or DB warpper libraries defines `from` method, like: $db->select()->from(); thanks On We

[PHP-DEV] Re: 回复: [PHP-DEV] [RFC] Proposal namespace importing with from syntax

2012-07-24 Thread Stas Malyshev
Hi! > No, we can not import namespace directly for now : Of course you can. You just missing on what namespace import means in PHP, it's not like Java (though a bit like Python). > namespace A { > class B {} > } > > namespace { > use A; > > var_dump(new B()); > } use A is a no-op, just a

[PHP-DEV] 回复: [PHP-DEV] [RFC] Proposal namespace importing with from syntax

2012-07-24 Thread Reeze Xia
Hi Stas, 在 2012年7月25日星期三,上午2:33,Stas Malyshev 写道: > Hi! > > > from GlobalNamespace\SubSpace\ThirdSace use Class1, Class2 as Alias2, > > ForthSpace\Class3 as Alias3; > > I'm not sure it's necessary. If you import a real lot of the classes > from the same namespace, just import the parent na

Re: [PHP-DEV] [RFC] Proposal namespace importing with from syntax

2012-07-24 Thread Stas Malyshev
Hi! > from GlobalNamespace\SubSpace\ThirdSace use Class1, Class2 as Alias2, > ForthSpace\Class3 as Alias3; I'm not sure it's necessary. If you import a real lot of the classes from the same namespace, just import the parent namespace. And this syntax makes less clear what is the true name of Cla

[PHP-DEV] 回复: [PHP-DEV] [RFC] Proposal namespace importing with from syntax

2012-07-24 Thread Reeze
Hi Andrew, 在 2012年7月24日星期二,下午11:39,Andrew Faulds 写道: > On 24/07/12 16:35, Reeze wrote: > > Hi, internals, > > I'm proposing a improvement to namespace importing. when using 'use' > > statement to import > > many classes, we have to duplicate many times even we are importing from > > the same na

Re: [PHP-DEV] [RFC] Proposal namespace importing with from syntax

2012-07-24 Thread Andrew Faulds
On 24/07/12 16:35, Reeze wrote: Hi, internals, I'm proposing a improvement to namespace importing. when using 'use' statement to import many classes, we have to duplicate many times even we are importing from the same namespace. I propose a new syntax to import classes\functions\constant in a

[PHP-DEV] [RFC] Proposal namespace importing with from syntax

2012-07-24 Thread Reeze
Hi, internals, I'm proposing a improvement to namespace importing. when using 'use' statement to import many classes, we have to duplicate many times even we are importing from the same namespace. I propose a new syntax to import classes\functions\constant in a single statement. here is the e