On September 7, 2004 09:15 am, Leopold Toetsch wrote:
What do we do against collisions? During Pie-thon hacking I came along this problem:
Or similiar:
.namespace ["foo" ; "bar" ]
prohibits any "foo" global in the top-level namespace.
leo
While thinking about this very thing for a VM I was/am working on, a class isa namespace. And really, I'd probably start by implementing namespaces as a simple Hash. so, class isa namespace isa hash isa type. (type is my pmc like thing, I can't believe I thought about my "type" stuff before I started reading this list :o)
How well this will actually work for me or Parrot? I've no idea.
I can think of two ways to go:
1) namespace name mangling. E.g each namespace name gets a '\x0' prepended.
2) a special kind of hash that allows one key holding a leaf name entry *and* a subnamespace hash.
leo