feat: replace IO class with System class and remove separate IO module
- Delete wren_io.c, wren_io.h, and io.wren source files - Remove multi-arity print overloads and IO.read/IO.time methods - Add System class with print, printAll, write, writeAll methods to core.wren - Update all documentation examples and README to use System.print instead of IO.print
This commit is contained in:
@@ -11,6 +11,6 @@ class Foo {
|
||||
}
|
||||
|
||||
var foo = Foo.new()
|
||||
IO.print(foo.closeOverGet.call()) // expect: Foo field
|
||||
System.print(foo.closeOverGet.call()) // expect: Foo field
|
||||
foo.closeOverSet.call()
|
||||
IO.print(foo.closeOverGet.call()) // expect: new value
|
||||
System.print(foo.closeOverGet.call()) // expect: new value
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class Foo {
|
||||
construct new() {}
|
||||
write { IO.print(_field) }
|
||||
write { System.print(_field) }
|
||||
}
|
||||
|
||||
Foo.new().write // expect: null
|
||||
|
||||
@@ -10,11 +10,11 @@ class Foo {
|
||||
}
|
||||
|
||||
write {
|
||||
IO.print(_a)
|
||||
IO.print(_b)
|
||||
IO.print(_c)
|
||||
IO.print(_d)
|
||||
IO.print(_e)
|
||||
System.print(_a)
|
||||
System.print(_b)
|
||||
System.print(_c)
|
||||
System.print(_d)
|
||||
System.print(_e)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,19 +3,19 @@ class Outer {
|
||||
|
||||
method {
|
||||
_field = "outer"
|
||||
IO.print(_field) // expect: outer
|
||||
System.print(_field) // expect: outer
|
||||
|
||||
class Inner {
|
||||
construct new() {}
|
||||
|
||||
method {
|
||||
_field = "inner"
|
||||
IO.print(_field) // expect: inner
|
||||
System.print(_field) // expect: inner
|
||||
}
|
||||
}
|
||||
|
||||
Inner.new().method
|
||||
IO.print(_field) // expect: outer
|
||||
System.print(_field) // expect: outer
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ class Node {
|
||||
_left.write()
|
||||
}
|
||||
|
||||
IO.print(_value)
|
||||
System.print(_value)
|
||||
|
||||
if (_right is Node) {
|
||||
_right.write()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class Foo {
|
||||
construct new() {}
|
||||
write { IO.print(_field) } // Compile a use of the field...
|
||||
write { System.print(_field) } // Compile a use of the field...
|
||||
init { _field = "value" } // ...before an assignment to it.
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user