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


In src/core/Range.pm there is a simpier version of .perl method,
commented out due to 'not working in current ng'. It works well
nowadays, and this patch makes use of it.

Kind regards,
Ted
>From f8231cb71603e012bb9b1cf7e1e747bbbb211a7c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tadeusz=20So=C5=9Bnierz?= <[email protected]>
Date: Sat, 14 Aug 2010 00:36:39 +0000
Subject: [PATCH] Uncommented the simplier version of Range.perl

---
 src/core/Range.pm |   21 ++++++---------------
 1 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/src/core/Range.pm b/src/core/Range.pm
index 6c6f092..578f489 100644
--- a/src/core/Range.pm
+++ b/src/core/Range.pm
@@ -40,22 +40,13 @@ class Range is Iterable does Positional {
     multi method from() { $.min; }
     multi method to() { $.max; }
 
-    # Beautiful implementation which does not work yet in ng
-    # our Str multi method perl() {
-    #     [~]
-    #         $.min.perl,
-    #         ("^" if $.excludes_min),
-    #         "..",
-    #         ("^" if $.excludes_max),
-    #         $.max.perl;
-    # }
-
     our Str multi method perl() {
-        my $min = $.min ~~ ::Whatever ?? "*" !! $.min.perl;
-        my $emin = $.excludes_min ?? "^" !! "";
-        my $max = $.max ~~ ::Whatever ?? "*" !! $.max.perl;
-        my $emax = $.excludes_max ?? "^" !! "";
-        $min ~ $emin ~ ".." ~ $emax ~ $max;
+        [~]
+            $.min.perl,
+            ("^" if $.excludes_min),
+            "..",
+            ("^" if $.excludes_max),
+            $.max.perl;
     }
 
     multi method pick() {
-- 
1.7.1.1

Reply via email to