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
+1 -1
View File
@@ -1 +1 @@
IO.print("Hello, world!")
System.print("Hello, world!")
+1 -1
View File
@@ -5,4 +5,4 @@ class Lovecraft {
say() { Cthulu.new().message }
}
IO.print(Lovecraft.new().say())
System.print(Lovecraft.new().say())
+3 -3
View File
@@ -29,8 +29,8 @@ for (yPixel in 0...24) {
}
}
IO.write(pixel)
System.write(pixel)
}
IO.print("")
}
System.print()
}
-1
View File
@@ -1 +0,0 @@
IO.print("Hello, world!")
+5 -5
View File
@@ -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 {