lib: move the `times` method to Int
authorAlexis Laferrière <alexis.laf@xymus.net>
Sat, 16 Nov 2013 17:29:55 +0000 (12:29 -0500)
committerAlexis Laferrière <alexis.laf@xymus.net>
Sat, 16 Nov 2013 17:30:52 +0000 (12:30 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/standard/collection/range.nit

index 1b4d5bb..3855be7 100644 (file)
@@ -101,10 +101,10 @@ class IteratorRange[E: Discrete]
        end
 end
 
-redef class Discrete
+redef class Int
        # Returns the range from 0 to `self-1`, is used to do:
        #
        #    for i in 3.times do print "Cool"
        #    for i in 100.times do print "{i}/100"
-       fun times: Range[OTHER] do return new Range[OTHER](0, self-1)
+       fun times: Range[Int] do return [0 .. self[
 end