We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7c61c23 commit 21de975Copy full SHA for 21de975
1 file changed
lib/core/collection/list.nit
@@ -70,9 +70,12 @@ class List[E]
70
end
71
72
# Return a list of elements between 'from' and 'to'.
73
- fun slice(from: Int, to: Int): List[E] do
74
- assert from >= 0 and from < length
75
- assert to >= 0 and to < length and from <= to
+ #
+ # EXPECTS(from >= 0 and from < length and to >= 0 and to < length and from <= to)
+ fun slice(from: Int, to: Int): List[E]
76
+ is
77
+ expects(from >= 0 and from < length and to >= 0 and to < length and from <= to)
78
+ do
79
var list = new List[E]
80
while from <= to do
81
list.add(self[from])
0 commit comments