"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,11 +1,11 @@
|
||||
import "module" for Module, Other
|
||||
|
||||
IO.print(Module) // expect: before
|
||||
System.print(Module) // expect: before
|
||||
|
||||
// Reassigning the variable in the other module does not affect this one's
|
||||
// binding.
|
||||
Other.change
|
||||
IO.print(Module) // expect: before
|
||||
System.print(Module) // expect: before
|
||||
|
||||
// But it does change there.
|
||||
Other.show // expect: after
|
||||
|
||||
@@ -7,6 +7,6 @@ class Other {
|
||||
}
|
||||
|
||||
static show {
|
||||
IO.print(Module)
|
||||
System.print(Module)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// nontest
|
||||
IO.print("start a")
|
||||
System.print("start a")
|
||||
|
||||
var A = "a value"
|
||||
IO.print("a defined ", A)
|
||||
System.print("a defined " + A)
|
||||
import "b" for B
|
||||
IO.print("a imported ", B)
|
||||
System.print("a imported " + B)
|
||||
|
||||
IO.print("end a")
|
||||
System.print("end a")
|
||||
@@ -1,9 +1,9 @@
|
||||
// nontest
|
||||
IO.print("start b")
|
||||
System.print("start b")
|
||||
|
||||
var B = "b value"
|
||||
IO.print("b defined ", B)
|
||||
System.print("b defined " + B)
|
||||
import "a" for A
|
||||
IO.print("b imported ", A)
|
||||
System.print("b imported " + A)
|
||||
|
||||
IO.print("end b")
|
||||
System.print("end b")
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
// nontest
|
||||
IO.print(Bool)
|
||||
IO.print(Class)
|
||||
IO.print(Fiber)
|
||||
IO.print(Fn)
|
||||
IO.print(List)
|
||||
IO.print(Map)
|
||||
IO.print(MapKeySequence)
|
||||
IO.print(MapValueSequence)
|
||||
IO.print(Null)
|
||||
IO.print(Num)
|
||||
IO.print(Object)
|
||||
IO.print(Range)
|
||||
IO.print(Sequence)
|
||||
IO.print(String)
|
||||
System.print(Bool)
|
||||
System.print(Class)
|
||||
System.print(Fiber)
|
||||
System.print(Fn)
|
||||
System.print(List)
|
||||
System.print(Map)
|
||||
System.print(MapKeySequence)
|
||||
System.print(MapValueSequence)
|
||||
System.print(Null)
|
||||
System.print(Num)
|
||||
System.print(Object)
|
||||
System.print(Range)
|
||||
System.print(Sequence)
|
||||
System.print(String)
|
||||
|
||||
@@ -4,7 +4,7 @@ if (true) {
|
||||
import "module" for Module
|
||||
// expect: ran module
|
||||
|
||||
IO.print(Module) // expect: from module
|
||||
System.print(Module) // expect: from module
|
||||
}
|
||||
|
||||
IO.print(Module) // expect: outer
|
||||
System.print(Module) // expect: outer
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
// nontest
|
||||
var Module = "from module"
|
||||
IO.print("ran module")
|
||||
System.print("ran module")
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
import "something" for Index
|
||||
|
||||
IO.print(Index) // expect: index
|
||||
System.print(Index) // expect: index
|
||||
@@ -5,4 +5,4 @@ var Module3 = "from module three"
|
||||
var Module4 = "from module four"
|
||||
var Module5 = "from module five"
|
||||
|
||||
IO.print("ran module")
|
||||
System.print("ran module")
|
||||
|
||||
@@ -3,8 +3,8 @@ import "module" for Module1, Module2, Module3, Module4, Module5
|
||||
// Only execute module body once:
|
||||
// expect: ran module
|
||||
|
||||
IO.print(Module1) // expect: from module one
|
||||
IO.print(Module2) // expect: from module two
|
||||
IO.print(Module3) // expect: from module three
|
||||
IO.print(Module4) // expect: from module four
|
||||
IO.print(Module5) // expect: from module five
|
||||
System.print(Module1) // expect: from module one
|
||||
System.print(Module2) // expect: from module two
|
||||
System.print(Module3) // expect: from module three
|
||||
System.print(Module4) // expect: from module four
|
||||
System.print(Module5) // expect: from module five
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
// nontest
|
||||
IO.print("ran module")
|
||||
System.print("ran module")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// nontest
|
||||
IO.print("a")
|
||||
System.print("a")
|
||||
import "shared" for Shared
|
||||
var A = "a " + Shared
|
||||
IO.print("a done")
|
||||
System.print("a done")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// nontest
|
||||
IO.print("b")
|
||||
System.print("b")
|
||||
import "shared" for Shared
|
||||
var B = "b " + Shared
|
||||
IO.print("b done")
|
||||
System.print("b done")
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
// nontest
|
||||
IO.print("shared")
|
||||
System.print("shared")
|
||||
var Shared = "shared"
|
||||
|
||||
@@ -8,5 +8,5 @@ import "b" for B
|
||||
// expect: b
|
||||
// expect: b done
|
||||
|
||||
IO.print(A) // expect: a shared
|
||||
IO.print(B) // expect: b shared
|
||||
System.print(A) // expect: a shared
|
||||
System.print(B) // expect: b shared
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
// nontest
|
||||
var Module = "from module"
|
||||
IO.print("ran module")
|
||||
System.print("ran module")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import "module" for Module
|
||||
// expect: ran module
|
||||
|
||||
IO.print(Module) // expect: from module
|
||||
System.print(Module) // expect: from module
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
// nontest
|
||||
var Module = "from module"
|
||||
IO.print("ran module")
|
||||
System.print("ran module")
|
||||
|
||||
Reference in New Issue
Block a user