Closed eamanu closed 5 years ago
newt_builtin_print*
is returned NEWT_ZERO. Why? if it is just a print why return? I propose use a "wrapper" that call to existing newt_built_print*
instructions but returning void
Newt doesn't have 'void' values, so every function has to return 'something'. The top level interpreter loop prints the value for every expression evaluated so you can see the value of something like '1+1'. As 'print' returns 0, that's what you see in the output. Python has a 'void' value which lets it tell when an expression has an interesting result and when it doesn't. So, this is working 'as designed', but I agree that it might be nice if a 'void' value were added so that you wouldn't see this noise.
Great! Could I take this enhancement, please?
Sorry, missed your comment from last month! Of course, if you want to add a 'void' value to avoid printing spurious zeros, that would be fun to see.
Hello,
When I use the built-in functions print and printn this add a '0' on the end of the line: