Open oderwat opened 6 days ago
So, this is interesting and naturally would be cool to add.
But I would put this on the back of the list for now, because I believe it would be lots of work. Things it would require from the top of my head:
go get
, go import
and some hacks to make it work, that I'm not sure would work the same when building a package as opposed to main
. Not sure.%ls
, %rm
and %reset
special commands to handle packages.(As always, if you want to take a stab at it be my guest).
As an alternative -- probably not what you want, but ... -- during the GoMLX project development, I worked the whole time with gonb
opened, using go work use <local gomlx path>
, so I could keep editing in GoLand and playing around in GoNB, without having to do anything. Even the auto-complete in GoNB would pick up changes I made in GoLand immediately.
Hello @janpfeifer,
I just wondered if it is possible to create a package inside of the cells of a notebook. Would that be difficulty to implement?
How about something like
%package something
in the head of the cell to indicate that the code goes into a package. GONB then would create a directory namedsomething
and adds the code of all cells with that same package name into a file and prepends it with thepackage something
header.This package could then getting imported as all the others and help to write code that can easier be copied 1:1 into external projects.