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