I have a fix which currently suits my need. But the real problem, like
you said in IRC is to eventually merge the
PGE and the rakudo implementations of protoobjects.
I note that S12 that .WHAT and .WHO should return objects that
stringifies to strings and not directly strings
like in PGE implementation.
Index: runtime/parrot/library/Protoobject.pir
===================================================================
--- runtime/parrot/library/Protoobject.pir (revision 27312)
+++ runtime/parrot/library/Protoobject.pir (working copy)
@@ -148,6 +148,12 @@
.return ($S0)
.end
+.sub 'WHO' :method
+ $P0 = typeof self
+ $S0 = $P0.'name'()
+ .return ($S0)
+.end
+
# Local Variables:
# mode: pir
# fill-column: 100
On Mon, May 5, 2008 at 7:46 PM, Patrick R. Michaud via RT
<parrotbug-followup@parrotcode.org> wrote:
>
> On Mon, May 05, 2008 at 10:20:30AM -0700, Stephane Payrard wrote:
> > The following PIR program prints "Match". I would expect "PGE::Match".
> > I don't see the reason that motivates the current behavior
> >
> > .sub main
> > .local pmc match
> > .local string s
> > load_bytecode "compilers/pge/PGE.pbc"
> > match = new "PGE::Match"
> > # trace 1
> > s = match.'WHAT'()
> > say s
> > .end
>
>
> S12 says that .WHAT stringifies to a short name, which is the reason
> for the current behavior.
>
> S12 also says that .WHO stringifies to the long name, which might be
> what you expect.
>
> So, perhaps we need to implement .WHO . But that should probably
> be done as part of Protoobject (which needs a bit of a refactor
> anyway to make it even more Perl6ish).
>
> Pm
>
>
>
--
cognominal stef
Thread Previous