[perl #41825] [BUG] morph vtable override not working in PIR

Andrew Whitworth wknight8111 at gmail.com
Mon Jan 19 14:03:00 UTC 2009


On Mon, Jan 19, 2009 at 12:27 AM, Allison Randal <allison at parrot.org> wrote:
> 'morph' was added specifically for the Perl 5 behavior of changing types
> when assigned to. But really, a more accurate representation of Perl 5
> behavior would be to have a single Scalar PMC that can act as a string,
> int, or number.
>
> So, yes, it's possible that 'morph' could be deprecated. It needs a
> review of current uses to make sure that they're either unnecessary
> (most examples I've seen are), or can be cleanly substituted with
> something else.

I'll take a look either today or tomorrow to see what kinds of uses
there are of this opcode. I can tell you that only about 5 PMC types
currently have a morph vtable interface, and two or three of those
have trivial implementations (like calling SUPER(), or an empty
function, etc). I'll take a look at it to see if deprecation is
feasible.

There are some cases where we want to be able to convert data in one
format to another format. What we don't want to have to do is replace
calls to a morph vtable method with a PCCINVOKE of a special-purpose
method on that pmcs. If we find there are a limited number of
conversions required in Parrot core, we could replace them with
special-purpose functions somewhere.

--Andrew Whitworth


More information about the parrot-dev mailing list