develooper Front page | perl.cvs.parrot | Postings from November 2008

[svn:parrot] r32627 - trunk/languages/perl6/src/classes

From:
pmichaud
Date:
November 13, 2008 13:32
Subject:
[svn:parrot] r32627 - trunk/languages/perl6/src/classes
Message ID:
20081113213212.2EB25CB9AF@x12.develooper.com
Author: pmichaud
Date: Thu Nov 13 13:32:11 2008
New Revision: 32627

Modified:
   trunk/languages/perl6/src/classes/Str.pir

Log:
[rakudo]:  Encourage Parrot String PMCs to promote to Rakudo Str.


Modified: trunk/languages/perl6/src/classes/Str.pir
==============================================================================
--- trunk/languages/perl6/src/classes/Str.pir	(original)
+++ trunk/languages/perl6/src/classes/Str.pir	Thu Nov 13 13:32:11 2008
@@ -32,6 +32,16 @@
 .end
 
 
+## special method to cast Parrot String into Rakudo Str.
+.namespace ['String']
+.sub 'Scalar' :method
+    $P0 = new 'Str'
+    assign $P0, self
+    .return ($P0)
+.end
+
+
+.namespace ['Str']
 .sub 'ACCEPTS' :method
     .param string topic
     .tailcall 'infix:eq'(topic, self)



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