Hierarchical Namespaces

Suggestions for new Logtalk features

Moderator: Paulo Moura

Post Reply
rbt
Posts: 17
Joined: Tue Feb 09, 2010 10:21 am

Hierarchical Namespaces

Post by rbt » Mon Oct 11, 2010 4:02 pm

When the projects are getting bigger and existing Logtalk code should be reused in new projects then the flat namespaces might be become annoying. Paulo, did you ever thought about the support of hierarchical namespaces (e.g., like in Java)? Or is there another approach to deal with the problem of having objects with the same name?

Best.

rbt

Paulo Moura
Logtalk developer
Posts: 474
Joined: Sat May 05, 2007 8:35 am
Location: Portugal
Contact:

Re: Hierarchical Namespaces

Post by Paulo Moura » Mon Oct 11, 2010 6:47 pm

Back in 2002~2003, while writing my thesis, I toyed with the idea of implementing object namespaces as found in C++. I never found, however, a convincing example that justified the added complexity. More recently, I experimented with object aliases as a partial solution to deal with object renaming. The idea sounded nice and simple on paper but implementing it on a dynamic language (where queries and entities can be generated at runtime) proved difficult and error prone.

I have not given up on implementing some sort of object namespaces but currently is not a priority. Right now, and for the next 6 or 7 months, I'm planning on spending most development time working on coinduction, ProbLog, and CHR support.

I don't currently have any solution to deal with object name conflicts but any suggestions that you might have are most welcome. Please feel free to discuss them here or by mail.
Paulo Moura
Logtalk developer

Jaetan
Posts: 13
Joined: Thu Apr 09, 2009 11:35 am
Location: Tōkyō, Japan

Re: Hierarchical Namespaces

Post by Jaetan » Fri Nov 05, 2010 1:14 pm

The namespaces in C++ are very static in nature... For a dynamic language, did you look for example at the namespaces in GNU Smalltalk and Python ? Python, not being an "objects only" language, could provide interesting ideas I believe.

Paulo Moura
Logtalk developer
Posts: 474
Joined: Sat May 05, 2007 8:35 am
Location: Portugal
Contact:

Re: Hierarchical Namespaces

Post by Paulo Moura » Thu Nov 25, 2010 12:03 pm

Sorry for the late reply; I'm busy getting Logtalk 2.42.0 ready for release. Regarding your suggestions, I took a look to GNU Smalltalk and Python namespaces and found the semantics a bit troublesome, both from an implementation perspective and from an user perspective. I'm thinking of something more simpler, possible based on the Java package concept.
Paulo Moura
Logtalk developer

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest