On Sat, 9 Oct 2004, Sam Ruby wrote:

> Inheritance can reduce the combinatorial problem, but it can introduce a
> precendence question.  The most interesting case still seems to be:
>
>    mmd_lookup(MMD_ADD, PerlString, PyString)


What if, as a fallback mechanism, the foreign
object were cast into a simpler type? The PyString
could just have a marker on it that says it should
be downcast into a native string (or ParrotString) in
cross language situations. You could do the same for
all the basic types.

That way, if you evaluate $perlString + $pyString
in perl, you get perlish behavior, and if you
evaluate perlString+pyString in python, you get
pythonic behavior.

The only requirement is that you have an adapter
to make the language-specific types adhere to the
generic interface. Zope and Twisted do this kind
of thing all the time:

  http://twisted.sourceforge.net/TwistedDocs-1.2.0/howto/components.html


- Michal
http://withoutane.com/

Reply via email to