Closed edsko closed 9 years ago
I will close this as the commit above addresses the issue. I think we can clean up he print state in the Interpreter but I will refrain from doing this in case we need to revert some of this in the future.
With the change of having multiple arguments to print I think you could revert the behaviour of the interpreter. The point was that you could have print statements in code that was meant to be executed completely statically (computation of tables etc) so that you could debug it (and have the print statement shown at compile time instead). The behaviour was confusing because of the single-arugment problem, but that's gone now? Anyway, just my 2c :)
(Note that with your change, if you do insert print statements in otherwise statically evaluable code, the code will not be executed at compile time.)
The interpreter will execute prints with statically known arguments at compile time rather than at runtime, but if you write something like
in the source, this gets translated to two print statements in the AST, and consequently the interpreter will execute the first but not the second. We should change the AST so that print takes multiple arguments, and then change the interpreter so that it only executes the whole thing of all arguments are statically known.