"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:
Bob Nystrom
2015-09-15 07:46:09 -07:00
parent 66b89a493f
commit 58e4d26648
491 changed files with 3285 additions and 3544 deletions

View File

@ -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

View File

@ -1,5 +1,5 @@
class Foo {
static write { IO.print(__field) }
static write { System.print(__field) }
}
Foo.write // expect: null

View File

@ -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)
}
}

View File

@ -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)
}
}

View File

@ -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
}
}

View File

@ -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.
}