mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-11 14:18:42 +01:00
"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:
@ -11,6 +11,6 @@ class Foo {
|
||||
}
|
||||
|
||||
Foo.initialize
|
||||
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,5 +1,5 @@
|
||||
class Foo {
|
||||
static write { IO.print(__field) }
|
||||
static write { System.print(__field) }
|
||||
}
|
||||
|
||||
Foo.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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -8,11 +8,11 @@ class Foo {
|
||||
}
|
||||
|
||||
static 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,36 +3,36 @@ class Outer {
|
||||
|
||||
static staticMethod {
|
||||
__field = "outer"
|
||||
IO.print(__field) // expect: outer
|
||||
System.print(__field) // expect: outer
|
||||
|
||||
class Inner {
|
||||
construct new() {}
|
||||
|
||||
static staticMethod {
|
||||
__field = "inner"
|
||||
IO.print(__field) // expect: inner
|
||||
System.print(__field) // expect: inner
|
||||
}
|
||||
}
|
||||
|
||||
Inner.staticMethod
|
||||
IO.print(__field) // expect: outer
|
||||
System.print(__field) // expect: outer
|
||||
}
|
||||
|
||||
instanceMethod {
|
||||
__field = "outer"
|
||||
IO.print(__field) // expect: outer
|
||||
System.print(__field) // expect: outer
|
||||
|
||||
class Inner {
|
||||
construct new() {}
|
||||
|
||||
instanceMethod {
|
||||
__field = "inner"
|
||||
IO.print(__field) // expect: inner
|
||||
System.print(__field) // expect: inner
|
||||
}
|
||||
}
|
||||
|
||||
Inner.new().instanceMethod
|
||||
IO.print(__field) // expect: outer
|
||||
System.print(__field) // expect: outer
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
class Foo {
|
||||
static write { IO.print(__field) } // Compile a use of the field...
|
||||
static write { System.print(__field) } // Compile a use of the field...
|
||||
static init { __field = "value" } // ...before an assignment to it.
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user