Hacker News new | ask | show | jobs
by galangalalgol 1038 days ago
Its nothing earth shaking. I just type edit foo.m, select the lines from the history that worked and copy them to the new file, perhaps doing a quick namechange or two. It isn't anything a plugin could provide, and doctor doc strings tries to, but it is pretty clumsy, the name change refactoring thing isn't there, and more importantly, the idiomatic way to create a reusable module in julia is a lot heavier. I also run into issues of collisions between the new module and the lines I copied. I'm sure it is all resolvable, it just feels clunky out of the box after using it lightly for a year or so. I can use numpy the same way as matlab mostly, its just really slow. I haven't found a prototyping language other than matlab that I don't find myself thinking "might as well write it in rust as long as this is taking", as I know I'll end up doing that anyway.
1 comments

> the name change refactoring thing isn't there

what does Matlab provide wrt this? Does its editor have refactoring assistance now?

> the idiomatic way to create a reusable module in julia is a lot heavier

do you mean package creation?

> I also run into issues of collisions between the new module and the lines I copied.

what kind of collisions do you mean?

what would your ideal tool for this look like? you select parts of your REPL history, ask for some name changes in it, give it a package name, and have it generate a package? any other features or steps that come to mind as potentially helpful?

Matlab has some simple refactoring for names changes. Change a name and press shift+enter to change all other occurrences in the file.

Yes, package creation. The "right way" use create package.jl or whatever feels like a speedbump and requires setup.

When I import the newly created model, I have gotten name collisions with the playground remnants which you can't fully clear without restarting the repl.

That sounds like something I'd use, yeah. If you wanted to be fancy, you could make a function, putting uninitialized values into the argument list.