diff --git a/examples/io-test.rn b/examples/io-test.rn index a03e25a..63c538d 100644 --- a/examples/io-test.rn +++ b/examples/io-test.rn @@ -12,6 +12,5 @@ print(str_val) var password = io.Input.get_password("Enter a password: ") print(password) -# issue here var val = input("Enter a value: ") -io.Output.write(val) +io.Output.write(val, sep="\n") diff --git a/stdlib/io.rn b/stdlib/io.rn index 9e4bee8..77fadda 100644 --- a/stdlib/io.rn +++ b/stdlib/io.rn @@ -43,11 +43,12 @@ class Input { } class Output { - static fun write(...values, sep=" ", end="\n") { - var output = "" - for value in values { - output += str(value) + sep + static fun write(...values, sep=" ", end="\n") { + var ns = { + "values": values, + "sep": sep, + "end": end } - print(output + end) + pyapi("print(*values, sep=sep, end=end)", ns) } } \ No newline at end of file