"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:
@@ -1,7 +1,7 @@
|
||||
var Nonlocal = "before"
|
||||
IO.print(Nonlocal) // expect: before
|
||||
System.print(Nonlocal) // expect: before
|
||||
Nonlocal = "after"
|
||||
IO.print(Nonlocal) // expect: after
|
||||
System.print(Nonlocal) // expect: after
|
||||
|
||||
class Foo {
|
||||
static method {
|
||||
@@ -10,9 +10,9 @@ class Foo {
|
||||
}
|
||||
|
||||
Foo.method
|
||||
IO.print(Nonlocal) // expect: method
|
||||
System.print(Nonlocal) // expect: method
|
||||
|
||||
Fn.new {
|
||||
Nonlocal = "fn"
|
||||
}.call()
|
||||
IO.print(Nonlocal) // expect: fn
|
||||
System.print(Nonlocal) // expect: fn
|
||||
|
||||
@@ -2,7 +2,7 @@ var Nonlocal = "outer"
|
||||
|
||||
{
|
||||
var Nonlocal = "inner"
|
||||
IO.print(Nonlocal) // expect: inner
|
||||
System.print(Nonlocal) // expect: inner
|
||||
}
|
||||
|
||||
IO.print(Nonlocal) // expect: outer
|
||||
System.print(Nonlocal) // expect: outer
|
||||
|
||||
@@ -8,5 +8,5 @@ class Bar {
|
||||
static foo { Foo.new() }
|
||||
}
|
||||
|
||||
IO.print(Foo.bar) // expect: instance of Bar
|
||||
IO.print(Bar.foo) // expect: instance of Foo
|
||||
System.print(Foo.bar) // expect: instance of Bar
|
||||
System.print(Bar.foo) // expect: instance of Foo
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
var A = A == null
|
||||
IO.print(A) // expect: true
|
||||
System.print(A) // expect: true
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
var A
|
||||
IO.print(A) // expect: null
|
||||
System.print(A) // expect: null
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
IO.print(Foo) // expect: null
|
||||
System.print(Foo) // expect: null
|
||||
var Foo = "value"
|
||||
IO.print(Foo) // expect: value
|
||||
System.print(Foo) // expect: value
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
var fn = Fn.new {
|
||||
IO.print(Foo)
|
||||
IO.print(Bar)
|
||||
System.print(Foo)
|
||||
System.print(Bar)
|
||||
}
|
||||
|
||||
// expect error line 6
|
||||
@@ -1,5 +1,5 @@
|
||||
var Global = "global"
|
||||
|
||||
Fn.new {
|
||||
IO.print(Global) // expect: global
|
||||
System.print(Global) // expect: global
|
||||
}.call()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
var f = Fn.new {
|
||||
IO.print(Global)
|
||||
System.print(Global)
|
||||
}
|
||||
|
||||
var Global = "global"
|
||||
|
||||
@@ -4,11 +4,11 @@ class Foo {
|
||||
construct new() {}
|
||||
|
||||
method {
|
||||
IO.print(Global)
|
||||
System.print(Global)
|
||||
}
|
||||
|
||||
static classMethod {
|
||||
IO.print(Global)
|
||||
System.print(Global)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@ class Foo {
|
||||
construct new() {}
|
||||
|
||||
method {
|
||||
IO.print(Global)
|
||||
System.print(Global)
|
||||
}
|
||||
|
||||
static classMethod {
|
||||
IO.print(Global)
|
||||
System.print(Global)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user