Jump to content

  • Log In with Google      Sign In   
  • Create Account


Scanning through namespaces


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 webwraith   Members   -  Reputation: 221

Like
0Likes
Like

Posted 03 March 2011 - 03:28 PM

I'm currently working on a class-based scripting language as an experiment. I'm using the D programming language, and no IDE.

The problem is that I'm not sure how to get the "processor" to search for names. I have the basis of namespaces down in my head, but at the moment I have no way of specifying how to look through imported modules.

The following is what I have so far.

class Namespace{
 	Namespace parent;
 	Namespace[ wchar[] ] children; // equivalent to C++'s std::map< std::basic_string< wchar_t >, Namespace >
 }

I wanted to ask, how would I go about actually importing the symbols of the requested module? Would I, say, keep a link for each module, testing them after testing the current namespace? How do other scripting languages deal with namespaces?

EDIT:At the moment, I have decided to have each namespace contain a "type" value which tells the "processor" whether the namespace is global, module, class or code block. I'm using this to decide how to handle each namespace. Is this a sensible way to go about this?

Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS