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