Hi!

> namespace foo {
>     use function biz\buz;
>     use foo\bar;
> 
>     something(); // autoloaded as "something"

Wait, so it wouldn't work like class autoloader, using fully qualified
name? And autoloader would not then have any information about
namespaces, so you'd have to specify explicit imports or full namespace
names for any namespaced functions you use in your code?

That doesn't sound very practical. It's much easier to do one require
than to import manually each function in the namespace and requiring to
explicitly name all of them removes half of the usefulness of namespaces
- if you wanted all the full names, you could use
very_long_names_like_this() as before.

I think we discussed all these problems last time function autoloading
topic came up.

Also it is weird that namespace name is added to bar\baz() but not to
bar(). This is contrary to how namespaces work in other places - where
namespace name is added to everything not fully quailified.

> Does that make sense?

Frankly, for me it doesn't. Now I recall namespaces resolution and
fallbacks was one of the reasons why function autoloading proposal
failed the last time. IMHO this is a pretty big problem for practical
usage of this - as pretty much the only case for function autoloading is
resting on namespaces, so if autoloader can't deal with namespaced
resolution rules, it's not good.
-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

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

Reply via email to