feat: add overloaded IO.print methods accepting 2-16 arguments and printList_ helper
Add 15 static overloads of IO.print in builtin/io.wren and src/wren_io.c, each delegating to a new private printList_ method that iterates over a list of objects. Update all benchmark and test files to use the new multi-argument syntax, removing explicit .toString calls and string concatenation. Add a comprehensive test/io/print.wren verifying single-argument return value, multi-argument null return, and concatenation of up to 16 arguments.
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
for (i in 0..2) {
|
||||
IO.print("outer " + i.toString)
|
||||
IO.print("outer ", i)
|
||||
if (i > 1) break
|
||||
|
||||
for (j in 0..2) {
|
||||
IO.print("inner " + j.toString)
|
||||
IO.print("inner ", j)
|
||||
if (j > 1) break
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
var i = 0
|
||||
while (true) {
|
||||
IO.print("outer " + i.toString)
|
||||
IO.print("outer ", i)
|
||||
if (i > 1) break
|
||||
|
||||
var j = 0
|
||||
while (true) {
|
||||
IO.print("inner " + j.toString)
|
||||
IO.print("inner ", j)
|
||||
if (j > 1) break
|
||||
|
||||
j = j + 1
|
||||
|
||||
Reference in New Issue
Block a user