"IO" -> "System".

Get rid of the separate opt-in IO class and replace it with a core
System class.

- Remove wren_io.c, wren_io.h, and io.wren.
- Remove the flags that disable it.
- Remove the overloads for print() with different arity. (It was an
  experiment, but I don't think it's that useful.)
- Remove IO.read(). That will reappear using libuv in the CLI at some
  point.
- Remove IO.time. Doesn't seem to have been used.
- Update all of the tests, docs, etc.

I'm sorry for all the breakage this causes, but I think "System" is a
better name for this class (it makes it natural to add things like
"System.gc()") and frees up "IO" for referring to the CLI's IO module.
This commit is contained in:
Bob Nystrom
2015-09-15 07:46:09 -07:00
parent 66b89a493f
commit 58e4d26648
491 changed files with 3285 additions and 3544 deletions
+5 -5
View File
@@ -59,7 +59,7 @@ and counting the number of times the returned value evaluates to `true`.
Iterates over the sequence, passing each element to the given `function`.
:::dart
["one", "two", "three"].each {|word| IO.print(word) }
["one", "two", "three"].each {|word| System.print(word) }
### **isEmpty**
@@ -88,7 +88,7 @@ original sequence while it is iterated.
:::dart
var doubles = [1, 2, 3].map {|n| n * 2 }
for (n in doubles) {
IO.print(n) // "2", "4", "6".
System.print(n) // "2", "4", "6".
}
The returned sequence is *lazy*. It only applies the mapping when you iterate
@@ -105,7 +105,7 @@ To force eager evaluation, just call `.toList` on the result.
var numbers = [1, 2, 3]
var doubles = numbers.map {|n| n * 2 }.toList
numbers.add(4)
IO.print(doubles) // [2, 4, 6].
System.print(doubles) // [2, 4, 6].
### **reduce**(function)
@@ -142,7 +142,7 @@ function `predicate`. If it returns `false`, the element is skipped.
:::dart
var odds = (1..10).where {|n| n % 2 == 1 }
for (n in odds) {
IO.print(n) // "1", "3", "5", "7", "9".
System.print(n) // "1", "3", "5", "7", "9".
}
The returned sequence is *lazy*. It only applies the filtering when you iterate
@@ -160,4 +160,4 @@ To force eager evaluation, just call `.toList` on the result.
var numbers = [1, 2, 3, 4, 5, 6]
var odds = numbers.where {|n| n % 2 == 1 }.toList
numbers.add(7)
IO.print(odds) // [1, 3, 5].
System.print(odds) // [1, 3, 5].