Skip to content

Commit

Permalink
fix: io Output.write method.
Browse files Browse the repository at this point in the history
  • Loading branch information
Almas-Ali committed Jun 1, 2024
1 parent fa4ffc0 commit 73eb2bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
3 changes: 1 addition & 2 deletions examples/io-test.rn
Original file line number Diff line number Diff line change
Expand Up @@ -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")
11 changes: 6 additions & 5 deletions stdlib/io.rn
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

0 comments on commit 73eb2bf

Please sign in to comment.