neugram / ng

scripting language integrated with Go
https://neugram.io
BSD 2-Clause "Simplified" License
916 stars 43 forks source link

ng/jupyter: improve the "v := ..." user experience in jupyter #197

Open sbinet opened 6 years ago

sbinet commented 6 years ago

in Jupyter, when one has a cell like this:

In [10]: v := foo()

if for some reason (debugging, improvement, what-ever) you need to re-run it, it will (rightfully) fail with:

ng: typecheck: no new variables on left side of :=

we should perhaps have special hooks in the jupyter front-end to analyze the cell being re-run, detect variable declarations and delete those to make typecheck happy.

the alternative would be to disable typecheck (for variable declarations) in Jupyter. but I personally would rather not.