"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
+4 -4
View File
@@ -4,15 +4,15 @@ var g = null
{
var local = "local"
f = Fn.new {
IO.print(local)
System.print(local)
local = "after f"
IO.print(local)
System.print(local)
}
g = Fn.new {
IO.print(local)
System.print(local)
local = "after g"
IO.print(local)
System.print(local)
}
}
@@ -2,7 +2,7 @@ var f = null
Fn.new {|param|
f = Fn.new {
IO.print(param)
System.print(param)
}
}.call("param")
@@ -7,7 +7,7 @@ Fn.new {
var a = "a"
var b = "b"
Fn.new {
IO.print(b) // expect: b
IO.print(a) // expect: a
System.print(b) // expect: b
System.print(a) // expect: a
}.call()
}.call()
@@ -5,7 +5,7 @@ class Foo {
method(param) {
F = Fn.new {
IO.print(param)
System.print(param)
}
}
}
@@ -3,7 +3,7 @@ var f = null
{
var local = "local"
f = Fn.new {
IO.print(local)
System.print(local)
}
}
@@ -7,7 +7,7 @@ var foo = null
construct new() {}
method {
IO.print(local)
System.print(local)
}
}
+3 -3
View File
@@ -7,9 +7,9 @@ Fn.new {
Fn.new {
var c = "c"
f = Fn.new {
IO.print(a)
IO.print(b)
IO.print(c)
System.print(a)
System.print(b)
System.print(c)
}
}.call()
}.call()
@@ -1,6 +1,6 @@
{
var local = "local"
Fn.new {
IO.print(local) // expect: local
System.print(local) // expect: local
}.call()
}
@@ -5,7 +5,7 @@
construct new() {}
method {
IO.print(local)
System.print(local)
}
}
@@ -3,8 +3,8 @@ var f = null
{
var a = "a"
f = Fn.new {
IO.print(a)
IO.print(a)
System.print(a)
System.print(a)
}
}
@@ -3,7 +3,7 @@
{
var a = "a"
f = Fn.new { IO.print(a) }
f = Fn.new { System.print(a) }
}
{
@@ -2,10 +2,10 @@
var foo = "closure"
Fn.new {
{
IO.print(foo) // expect: closure
System.print(foo) // expect: closure
var foo = "shadow"
IO.print(foo) // expect: shadow
System.print(foo) // expect: shadow
}
IO.print(foo) // expect: closure
System.print(foo) // expect: closure
}.call()
}