-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Top-level comptime
block is always undefined
in the REPL
#1195
Comments
This is a general question I guess for what the REPL should do for top-level statements that can be expressionized. Currently we do not expressionize, but perhaps we should in the REPL? Compare these examples:
Those So I think it'd be nice to wrap the top level in an IIFE at the Civet level so the last Civet expression gets returned to the REPL. Kind of an extension of the code I added recently to handle top-level |
Actually, I think this might be an issue worth extending beyond the REPL. There are settings where we write scripts where the last expression is meaningful. To support these use cases, I propose a |
While testing a local change to comptime serialization:
I would have expected the first one to also be
[Function (anonymous)] { a: 1 }
, but because top-level comptime blocks are deleted, there was nothing to evaluate and the result wasundefined
.The text was updated successfully, but these errors were encountered: