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:
+5
-5
@@ -9,7 +9,7 @@ class SyntaxExample {
|
||||
// Constructor
|
||||
construct new() {
|
||||
// Top-level name `IO`
|
||||
IO.print("I am a constructor!")
|
||||
System.print("I am a constructor!")
|
||||
|
||||
// Method calls
|
||||
variables
|
||||
@@ -58,7 +58,7 @@ class SyntaxExample {
|
||||
field=(value) { _field = value }
|
||||
|
||||
// Method with arguments
|
||||
print(a, b) { IO.print(a + b) }
|
||||
print(a, b) { System.print(a + b) }
|
||||
|
||||
// Operators
|
||||
+(other) { "infix + " + other }
|
||||
@@ -97,7 +97,7 @@ class ReservedWords is SyntaxExample {
|
||||
|
||||
// `for`, `in`
|
||||
for (beatle in ["george", "john", "paul", "ringo"]) {
|
||||
IO.print(beatle)
|
||||
System.print(beatle)
|
||||
// `break`
|
||||
break
|
||||
}
|
||||
@@ -147,9 +147,9 @@ class Literals is SyntaxExample {
|
||||
"\t" // Tab.
|
||||
"\v" // Vertical tab.
|
||||
// Unicode code points
|
||||
IO.print("\u0041fgdg\u0b83\u00DE") // "AஃÞ"
|
||||
System.print("\u0041fgdg\u0b83\u00DE") // "AஃÞ"
|
||||
// Unencoded bytes
|
||||
IO.print("\x48\x69\x2e") // "Hi."
|
||||
System.print("\x48\x69\x2e") // "Hi."
|
||||
}
|
||||
|
||||
ranges {
|
||||
|
||||
Reference in New Issue
Block a user