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


---
 src/classes/Range.pir |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/classes/Range.pir b/src/classes/Range.pir
index 6b7eeb9..4cdb54f 100644
--- a/src/classes/Range.pir
+++ b/src/classes/Range.pir
@@ -137,11 +137,23 @@ just return a clone of the Range.
 .namespace ['Range']
 
 .sub 'max' :method
+    .param pmc by       :optional
+    .param int has_by   :opt_flag
+    if has_by goto have_by
     .tailcall self.'to'()
+  have_by:
+    $P0 = self.'list'()
+    .tailcall $P0.'max'(by)
 .end
 
 .sub 'min' :method
+    .param pmc by       :optional
+    .param int has_by   :opt_flag
+    if has_by goto have_by
     .tailcall self.'from'()
+  have_by:
+    $P0 = self.'list'()
+    .tailcall $P0.'min'(by)
 .end
 
 .sub 'minmax' :method

Reply via email to