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:
Bob Nystrom
2015-09-15 14:46:09 +00:00
parent f12581a674
commit aa72900a9e
491 changed files with 3285 additions and 3544 deletions
+5 -5
View File
@@ -1,11 +1,11 @@
// Handle empty map.
IO.print({}.toString) // expect: {}
System.print({}.toString) // expect: {}
// Does not quote strings.
IO.print({"1": "2"}.toString) // expect: {1: 2}
System.print({"1": "2"}.toString) // expect: {1: 2}
// Nested maps.
IO.print({1: {2: {}}}) // expect: {1: {2: {}}}
System.print({1: {2: {}}}) // expect: {1: {2: {}}}
// Calls toString on elements.
class Foo {
@@ -13,12 +13,12 @@ class Foo {
toString { "Foo.toString" }
}
IO.print({1: Foo.new()}) // expect: {1: Foo.toString}
System.print({1: Foo.new()}) // expect: {1: Foo.toString}
// Since iteration order is unspecified, we don't know what order the results
// will be.
var s = {1: 2, 3: 4, 5: 6}.toString
IO.print(s == "{1: 2, 3: 4, 5: 6}" ||
System.print(s == "{1: 2, 3: 4, 5: 6}" ||
s == "{1: 2, 5: 6, 3: 4}" ||
s == "{3: 4, 1: 2, 5: 6}" ||
s == "{3: 4, 5: 6, 1: 2}" ||