durusmail: quixote-users: _q_lookup and namespaces
_q_lookup and namespaces
2003-06-10
2003-06-10
Re: _q_lookup and namespaces
2003-06-10
2003-06-11
2003-06-11
2003-06-11
2003-06-13
_q_lookup and namespaces
VanL
2003-06-10
Hello,

I have a question about the best way to do namespace traversal in quixote.

Sorry for the contrived example, but I think this best illustrates the
point.

Say I have an app that needs to map a URL

/numbers//

For example,
/numbers/15/binary would return '1111'
/numbers/15/octal would return '017'
/numbers/15/decimal would return '15'
/numbers/15/hexadecimal would return '0xf'

/numbers is a module, and the namespace is introduced by
import numbers

// is best mapped to a _q_lookup function.

How are the // best handled, though?

_q_lookup seems wrong considering there are only limited options.

An imported module seems like overkill.

I would suggest a class, but I don't see any provision to instantiate a
class before traversal (except through _q_lookup), and You wouldn't want
classes just hanging around in case they might be called.

_q_exports only seem to work for terminal parts of the url, not for the
definition of the proximate namespace.

Clarifications?  Is there something I am missing?

Thanks,

VanL



reply