Make Range a native object type.
Still need to implement better semantics, but this is an important first step. It's much faster now too, which is good.
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
var inclusive = 2..5
|
||||
IO.print(inclusive is Range) // expect: true
|
||||
IO.print(inclusive.min) // expect: 2
|
||||
IO.print(inclusive.max) // expect: 5
|
||||
|
||||
var exclusive = 2...5
|
||||
IO.print(exclusive is Range) // expect: true
|
||||
IO.print(exclusive.min) // expect: 2
|
||||
IO.print(exclusive.max) // expect: 4
|
||||
|
||||
// TODO: Non-number RHS.
|
||||
// TODO: Non-integer RHS.
|
||||
// TODO: Range iteration.
|
||||
// TODO: Empty or negative ranges.
|
||||
Reference in New Issue
Block a user