nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
87646dd
)
lib: move the `times` method to Int
author
Alexis Laferrière
<alexis.laf@xymus.net>
Sat, 16 Nov 2013 17:29:55 +0000
(12:29 -0500)
committer
Alexis 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
patch
|
blob
|
history
diff --git
a/lib/standard/collection/range.nit
b/lib/standard/collection/range.nit
index
1b4d5bb
..
3855be7
100644
(file)
--- 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