You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have read the roadmap and priorities and I believe this request falls within the priorities.
What is your request?
I think that the REPL should print the return values of functions automatically, similarly to what the Python interpreter does. Currently, I have to wrap function invocations in a print() to be able to see the result.
What is your motivation for this change?
I was trying the examples provided here inside the REPL, but the following two functions confused me:
def greet(name):
return "Hello, " name "!"
fn greet2(name: String) -> String:
return "Hello, " name "!"
In the first case, invoking the function from the REPL gives no output and in the second case I got a warning. Initially, I wondered if there was anything wrong with my installation, but then I figured out that I needed to wrap the invocation inside a call to print, like this: print(greet("Mario")). Usually, REPLs don't require explicitly calling print() to see a function's output, and I think Mojo's REPL should have the same behavior.
Any other details?
No response
The text was updated successfully, but these errors were encountered:
Review Mojo's priorities
What is your request?
I think that the REPL should print the return values of functions automatically, similarly to what the Python interpreter does. Currently, I have to wrap function invocations in a
print()
to be able to see the result.What is your motivation for this change?
I was trying the examples provided here inside the REPL, but the following two functions confused me:
In the first case, invoking the function from the REPL gives no output and in the second case I got a warning. Initially, I wondered if there was anything wrong with my installation, but then I figured out that I needed to wrap the invocation inside a call to print, like this:
print(greet("Mario"))
. Usually, REPLs don't require explicitly callingprint()
to see a function's output, and I think Mojo's REPL should have the same behavior.Any other details?
No response
The text was updated successfully, but these errors were encountered: