"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,5 +1,5 @@
|
||||
class Foo {
|
||||
this +(value) { // expect error
|
||||
IO.print("ok")
|
||||
System.print("ok")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Foo {
|
||||
this -(value) { // expect error
|
||||
IO.print("ok")
|
||||
System.print("ok")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Foo {
|
||||
this name=(value) { // expect error
|
||||
IO.print("ok")
|
||||
System.print("ok")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Foo {
|
||||
this [value] { // expect error
|
||||
IO.print("ok")
|
||||
System.print("ok")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Foo {
|
||||
this ! { // expect error
|
||||
IO.print("ok")
|
||||
System.print("ok")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class Foo {
|
||||
construct new() {
|
||||
IO.print("ok")
|
||||
System.print("ok")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ class Foo {
|
||||
toString { _field }
|
||||
}
|
||||
|
||||
IO.print(Foo.named()) // expect: named
|
||||
IO.print(Foo.other()) // expect: other
|
||||
System.print(Foo.named()) // expect: named
|
||||
System.print(Foo.other()) // expect: other
|
||||
|
||||
// Returns the new instance.
|
||||
var foo = Foo.named()
|
||||
IO.print(foo is Foo) // expect: true
|
||||
IO.print(foo.toString) // expect: named
|
||||
System.print(foo is Foo) // expect: true
|
||||
System.print(foo.toString) // expect: named
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Foo {
|
||||
this new { // expect error
|
||||
IO.print("ok")
|
||||
System.print("ok")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class A {
|
||||
construct new(arg) {
|
||||
IO.print("new A ", arg)
|
||||
System.print("new A " + arg)
|
||||
_field = arg
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ class A {
|
||||
class B is A {
|
||||
construct new(arg1, arg2) {
|
||||
super(arg2)
|
||||
IO.print("new B ", arg1)
|
||||
System.print("new B " + arg1)
|
||||
_field = arg1
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ class B is A {
|
||||
class C is B {
|
||||
construct new() {
|
||||
super("one", "two")
|
||||
IO.print("new C")
|
||||
System.print("new C")
|
||||
_field = "c"
|
||||
}
|
||||
|
||||
@@ -31,10 +31,10 @@ var c = C.new()
|
||||
// expect: new A two
|
||||
// expect: new B one
|
||||
// expect: new C
|
||||
IO.print(c is A) // expect: true
|
||||
IO.print(c is B) // expect: true
|
||||
IO.print(c is C) // expect: true
|
||||
System.print(c is A) // expect: true
|
||||
System.print(c is B) // expect: true
|
||||
System.print(c is C) // expect: true
|
||||
|
||||
IO.print(c.aField) // expect: two
|
||||
IO.print(c.bField) // expect: one
|
||||
IO.print(c.cField) // expect: c
|
||||
System.print(c.aField) // expect: two
|
||||
System.print(c.bField) // expect: one
|
||||
System.print(c.cField) // expect: c
|
||||
|
||||
Reference in New Issue
Block a user