what's so difficult about namespace?

Xah Lee xahlee at gmail.com
Wed Nov 26 15:15:58 CET 2008


On Nov 26, 5:45 am, Joshua Cranmer <Pidgeo... at verizon.invalid> wrote:
> > i cannot fathom what could possibly be difficult of
> > introducing or implementing a namespace mechanism into a language.
>
> Namespaces go to the very core of a language, name resolution.
> Retroactively adding such a feature is extremely difficult because there
> is a strong chance of accidentally breaking existing code.

could you give some technical detail on this?

i don't know compiler so am probably being foolish here... but i
suppose ultimately name resolution and storage at heart is something
like a hashtable...  namely,

put ‹identifier 1› table
put ‹identifier 2› table

and lookup is just

retrieve ‹identifier› table

and now suppose we introduced namespace, so i imagine the compiler
simply just concat namespace component befor put, and split before
retrieve?

  Xah
∑ http://xahlee.org/


More information about the Python-list mailing list