janpfeifer / gonb

GoNB, a Go Notebook Kernel for Jupyter
https://github.com/janpfeifer/gonb
MIT License
467 stars 32 forks source link

Imports, struct and functions can be reused in other cells but variables don't #87

Closed cczambrano12 closed 5 months ago

cczambrano12 commented 5 months ago

First of all thanks for this project, it is just what I was looking for. Everything works really good and I had been struggling to use most recent Go versions with other kernels.

This is mostly a question. From the next example I understand that imports, struct and functions can be reused in other cells but variables don't. I assume it has to do with the magic of "%%". I found this other related issue and the cache solution but I don't fully understand the cause of the issue and if it has something to do with how I am using %% cells (am I doing it wrong?).

Thanks for your help and for this awesome project!

Screen Shot 2024-01-15 at 12 49 39 PM
cczambrano12 commented 5 months ago

Don't worry, I just found all the responses to my questions in the tutorial notebook included in the project (my bad, I hadn't seen it). Thanks again! great project