Once again. I do not want classes/function from ORM lib to clutter my global namespace everywhere. I just want everything from it to be available in couple of files (where lots of SQL/mapping) is going to be used. In those few files I'll be able to keep control of names and avoid conflicts. Sure, I can prefix all the names or insert a bunch of imports, although it'll just be ugly.

Maybe if you use a really hairy ORM with a real lot of levels with real lot of namespaces on each level which you all need it might be a bit ugly. It's the same in other languages too - Java and Python code is no stranger to a bunch of imports at the start of the file. And BTW if you have such library structure blanket imports won't help you either since you'd have to do a bunch of imports to capture all the levels.

If using a bunch of imports is the only way that is accepted - then at least a shortcut like python's "from x import a,b,c,d,e,f,g,h" would be a nice.

Supporting comma syntax to group imports is probably a good idea, should hurt anything. As for supporting "from X import A, B, C" - I guess this is to mean "import X::A, X::B, X::C" - we need to think about it. Anyway, there's always an option of just using X::A, X::B and X::C - remember, putting things in global space is not a requirement, prefix is OK. What is not OK is a overly long prefix.
--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED]   http://www.zend.com/
(408)253-8829   MSN: [EMAIL PROTECTED]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to