
Originally Posted by
[size=1]Stanislav Malyshev[/size]
VS>> That is to say, if you have a FOLDER called System/ that contains a
VS>> class Object and a folder called Machine/, one called Web/, and in
VS>> Web/ there are classes and subdirectories, say UI/, and so forth.
OK. Starting from here: If you have System/Web/UI space, does it relate in
some way to System/Web space? If not, you've got exacly what we had in NS
implementation before it was removed, replacing '/' with ':', and even
probably less, since you did not describe how classes in the same space
relate. If yes, what would the relation be?
VS>> the keyword "import" means "look in the following space for class files",
VS>> then namespaces can be as simple as having
VS>>
VS>> import System.Web.UI
VS>>
VS>> mean "load all of the files in UI directory as includes(), but on the
This is not related to namespaces per se. This is autoloading mechanism,
which can be, BTW, implemented with no relation to namespaces whatsoever.
I once wrote package system proposal which based on lines along this, but
never actually got to implementing it, and now I see PEAR has its own
packaging system, which I have no time to learn either...
VS>> The rules would be as simple as saying import references
VS>> directory/subdirectory paths, and without an import command you use a
VS>> similar syntax to reference a class which resides in a file of the
VS>> same name.
So, there must be one-class-per-file approach? Not too good.
VS>> So
VS>>
VS>> import System.Object
VS>>
VS>> means there is a subdirectory in System/ called Object/.
VS>>
VS>> But
VS>>
VS>> class Something extends System.Object
VS>>
VS>> ignores the folder called Object and looks for (and errors our on the lack
VS>> of) a file called Object.php in the folder System/.
So, you got disk lookup on each 'extends' statement? No good.
VS>> Whatever syntax you use is a minor point, be it the traditional DOT
VS>> reference or your : or :: reference.
As a side point, dot reference is no more traditional than ':' or '::'.
VS>> I have tried to follow your issues about namespaces, and I have to
VS>> say I am afraid this email may not have addressed the issues
VS>> adequately. But I hope there might be some sort of use in this idea
VS>> that would resurrect the use of namespaces. It may not be
Your idea, as I see it, lies in the field of packaging implementation.
Namespaces is not the same as packaging, though the former can be used in
the latter. The problems with namespaces were not 'how do we locate this
class on disk', but how to implement scoping and scope importing in
logical, efficient and easy-to-use way. The decision was reached that the
way we have is not ripe for putting it into the language, so it was
removed.
Bookmarks