Re: Question about Namespace patch

From: Date: Mon, 23 Jul 2007 14:43:22 +0000
Subject: Re: Question about Namespace patch
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-31190@lists.php.net to get a copy of this message
Brian Moon wrote > > import SQLAlchemy::Column > > import SQLAlchemy::Table > > import SQLAlchemy::Join > > import SQLAlchemy::ForeignKey > > import SQLAlchemy::Session > > import SQLAlchemy::Transaction > > Why use namespaces if you are going to do this? You are just bringing > your classes into the global name space. The nice thing about > namespaces IMO, is that I don't have to have a class named > SQLAlchemy_Transaction. I can just have a class named Transaction in > the SQLAlchemy namespace. I can then create a new object using $obj = > new SQLAlchemy::Transaction. Because I just want those names directly available in one part of my application - the one which uses a lot of SQL. As far as I see this is not possibl with the proposed implementation - I can't do a local (file-scope or namespace-scope) import. All other languages I know that have namespaces (Java, python, C++) allow programmers to import other namespaces locally - usually for a single file. -- Paweł Stradomski

« previous php.internals (#31190) next »