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:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user