From de19d98026f024dcf56480840298810b69f47816 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Sat, 16 Nov 2013 12:29:55 -0500 Subject: [PATCH] lib: move the `times` method to Int MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- lib/standard/collection/range.nit | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/standard/collection/range.nit b/lib/standard/collection/range.nit index 1b4d5bb..3855be7 100644 --- a/lib/standard/collection/range.nit +++ b/lib/standard/collection/range.nit @@ -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 -- 1.7.9.5