Author: pmichaud
Date: Wed Nov 12 20:25:50 2008
New Revision: 32589
Modified:
trunk/languages/perl6/src/classes/Object.pir
Log:
[rakudo]: Add a .PARROTCLASS method, to report the real type.
Modified: trunk/languages/perl6/src/classes/Object.pir
==============================================================================
--- trunk/languages/perl6/src/classes/Object.pir (original)
+++ trunk/languages/perl6/src/classes/Object.pir Wed Nov 12 20:25:50 2008
@@ -430,6 +430,29 @@
.tailcall self.'WHERE'()
.end
+=item 'PARROTCLASS'
+
+Report the object's true nature.
+
+=cut
+
+.sub 'PARROTCLASS' :method
+ .local pmc obj
+ .local string result
+ obj = self
+ result = ''
+ $I0 = isa obj, 'ObjectRef'
+ unless $I0 goto have_obj
+ result = 'ObjectRef -> '
+ obj = deref obj
+ have_obj:
+ $P0 = typeof obj
+ $S0 = $P0
+ result .= $S0
+ .return (result)
+.end
+
+
=back
=head2 Private methods