# New Ticket Created by  Ahmad Zawawi 
# Please include the string:  [perl #59552]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=59552 >


Hello,

Here is the p5chop patch that makes our tests pass the first 4 tests.
To test it, please use the following command:

./perl6 t/spec/S29-str/p5chop.t 2>&1 | head

Thanks,
Ahmad Zawawi

Index: src/builtins/any-str.pir
===================================================================
--- src/builtins/any-str.pir    (revision 31564)
+++ src/builtins/any-str.pir    (working copy)
@@ -21,7 +21,7 @@
 .namespace []
 .sub 'onload' :anon :init :load
     $P0 = get_hll_namespace ['Any']
-    '!EXPORT'('capitalize chop chars index lc lcfirst rindex ord
substr uc ucfirst', 'from'=>$P0)
+    '!EXPORT'('capitalize chop p5chop chars index lc lcfirst rindex
ord substr uc ucfirst', 'from'=>$P0)
 .end


@@ -79,7 +79,29 @@
     .return ($I0)
 .end

+=item p5chop
+
+  our Char multi P5emul::Str::p5chop ( Str  $string is rw )
+  our Char multi P5emul::Str::p5chop ( Str [EMAIL PROTECTED] = ($+_) is rw )
+
+  Trims the last character from C<$string>, and returns it. Called with a
+  list, it chops each item in turn, and returns the last character
+  chopped.

+=cut
+
+.sub 'p5chop' :method :multi(_)
+    .local string tmps
+    .local string lastchar
+
+    tmps = self
+    substr lastchar, tmps, -1
+    chopn tmps, 1
+    self = tmps
+
+    .return(lastchar)
+.end
+
 =item chop

  our Str method Str::chop ( Str  $string: )

Reply via email to