Open dyoo opened 1 year ago
Thanks for reporting. This is a deliberate semantic difference between Pyret and e.g. WeScheme or DrRacket.
If definitions (or a REPL entry) has a dynamic error, its bindings are not carried forward into the next entry.
I'm fairly firm on this being a good decision (despite your justified surprised) because it turns out to be a real challenge to keep static and dynamic information about which bindings are available in sync if dynamically only some of the statically-available definitions evaluated.
Basically, we've been reticent to have the dynamic “undefined identifier” error of Typed Racket's REPL:
It appears that some context gets lost if there's an error in the running of the user's program, such that the interactions window doesn't have some bindings anymore. The screenshot should demonstrate the problem.
On the left pane is the program with an error: 8 * circle(25, "solid", "red")
which errors out as expected. However, on the right side, I try to play with circle expressions (for example, just referencing the circle identifier itself), and suddenly it looks like the runtime has no idea what "circle" means, much to my surprise.