develooper Front page | perl.cvs.parrot | Postings from January 2009

[svn:parrot] r35879 - in trunk/languages/perl6/src: builtins classes

From:
jonathan
Date:
January 22, 2009 03:55
Subject:
[svn:parrot] r35879 - in trunk/languages/perl6/src: builtins classes
Message ID:
20090122115521.C8CA0CB9AE@x12.develooper.com
Author: jonathan
Date: Thu Jan 22 03:55:20 2009
New Revision: 35879

Modified:
   trunk/languages/perl6/src/builtins/guts.pir
   trunk/languages/perl6/src/classes/Role.pir

Log:
[rakudo] What's installed in the namespace for a role should probably act like a proto-object a bit more; this makes it stringify in the same kinda way.

Modified: trunk/languages/perl6/src/builtins/guts.pir
==============================================================================
--- trunk/languages/perl6/src/builtins/guts.pir	(original)
+++ trunk/languages/perl6/src/builtins/guts.pir	Thu Jan 22 03:55:20 2009
@@ -372,6 +372,8 @@
     ns = variant.'get_namespace'()
     ns = ns.'get_name'()
     short_name = pop ns
+    $P0 = box short_name
+    setprop variant, "$!shortname", $P0
     $I0 = index short_name, '['
     if $I0 == -1 goto have_short_name
     short_name = substr short_name, 0, $I0
@@ -386,6 +388,8 @@
   need_role_obj:
     role_obj = new 'Perl6Role'
     set_root_global ns, short_name, role_obj
+    $P0 = box short_name
+    setprop role_obj, "$!shortname", $P0
   have_role_obj:
 
     # Add this variant.

Modified: trunk/languages/perl6/src/classes/Role.pir
==============================================================================
--- trunk/languages/perl6/src/classes/Role.pir	(original)
+++ trunk/languages/perl6/src/classes/Role.pir	Thu Jan 22 03:55:20 2009
@@ -216,6 +216,16 @@
 .end
 
 
+=item Str (vtable get_string)
+
+=cut
+
+.sub 'Str' :method :vtable('get_string')
+    $P0 = getprop '$!shortname', self
+    .return ($P0)
+.end
+
+
 =back
 
 =head1 Methods on Parrot Roles
@@ -289,6 +299,16 @@
     .return (self)
 .end
 
+
+=item Str (vtable get_string)
+
+=cut
+
+.sub 'Str' :method :vtable('get_string')
+    $P0 = getprop '$!shortname', self
+    .return ($P0)
+.end
+
 =back
 
 =cut



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About