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

[svn:parrot] r33685 - branches/assign/languages/perl6/src/classes

From:
pmichaud
Date:
December 8, 2008 19:02
Subject:
[svn:parrot] r33685 - branches/assign/languages/perl6/src/classes
Message ID:
20081209030239.940F4CB9AF@x12.develooper.com
Author: pmichaud
Date: Mon Dec  8 19:02:38 2008
New Revision: 33685

Modified:
   branches/assign/languages/perl6/src/classes/Object.pir

Log:
[rakudo]:  Restore 'item' contextualizer listop.


Modified: branches/assign/languages/perl6/src/classes/Object.pir
==============================================================================
--- branches/assign/languages/perl6/src/classes/Object.pir	(original)
+++ branches/assign/languages/perl6/src/classes/Object.pir	Mon Dec  8 19:02:38 2008
@@ -64,6 +64,21 @@
     .return (self)
 .end
 
+.namespace []
+.sub 'item'
+    .param pmc x               :slurpy
+    $I0 = elements x
+    unless $I0 == 1 goto have_x
+    x = shift x
+  have_x:
+    $I0 = can x, 'item'
+    unless $I0 goto have_item
+    x = x.'item'()
+  have_item:
+    .return (x)
+.end
+
+
 =item list
 
 Return invocant in list context.  Default is to return a List containing self.



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