Sam Ruby <[EMAIL PROTECTED]> wrote: > Leopold Toetsch wrote: > In Python terms, __add__ is but one of several methods that strings > have. Other common ones include index, join, lower, replace, and split.
I just used __add__ as an example. Of course all (differing) vtables and methods would need the adjustment depending on the code origin. > Do we want to go so far as "if the code origin in Python, then > MMD("get_attr", string, "index") returns the Python str.index function > bound to this instance? Baically yes, albeit C<get_attr> isn't a MMD function. Its a plain vtable function C<get_attr_str>. >> It's of course a language issue. *But* if we want to run Python, we have >> basically two choices: >> 1) force Python coders to write "a".concat("b") with a language change >> 2) implement the MMD add function for strings, so that it acts >> differently depending on the code origin. >> The latter minimizes the difference of String/PerlString/PyString to >> probably nothing. > Or we require a Python programmer to use the "str" function on any > potentially foreigh object received as a parameter if they wish to > depend on Python string semantics. That's similar to or a generalization of 1). It IMHO implies that Python on Parrot willl not be used much. > - Sam Ruby leo