Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow .nbt files to be loaded in REPL environment #573

Open
NogginBops opened this issue Sep 20, 2024 · 6 comments
Open

Allow .nbt files to be loaded in REPL environment #573

NogginBops opened this issue Sep 20, 2024 · 6 comments

Comments

@NogginBops
Copy link

It's very handy for testing and development to be able to load functions specified in a file into an interactive session.

This might be possible using modules (?), but the documentation around modules is very lacking and it's very unclear how you would load a file in the REPL environment.

@sharkdp
Copy link
Owner

sharkdp commented Sep 20, 2024

Did you see this part of the documentation? If not, where did you look? What did you search for?

https://numbat.dev/doc/cli-customization.html#custom-functions-constants-units

@NogginBops
Copy link
Author

I don't want to have the file be in some modules folder. I want to be able to load any file anywhere on my computer. Like loading files in prolog repl or similar.

@Goju-Ryu
Copy link
Contributor

I could see utility in a command that loads the contents of a file not necessarily in a modules folder. It would make it easier to use the cli as a REPL while developing a script, without cluttering the namespace with each new project or having to update configurations or environment variables for each.
When writing F# code, I frequently do something similar by loading scripts into fsi to experiment with the outputs of the functions I wrote. Currently I often do the same in Numbat by copy and pasting definitions manually.

@sharkdp
Copy link
Owner

sharkdp commented Oct 8, 2024

Okay. So basically the counterpart to the save command. Sounds reasonable.

@Bzero
Copy link
Contributor

Bzero commented Oct 14, 2024

I started working on this feature but was not sure how to call the new command. Maybe load as the opposite of save or just run possibly?

@sharkdp
Copy link
Owner

sharkdp commented Oct 23, 2024

I started working on this feature but was not sure how to call the new command. Maybe load as the opposite of save or just run possibly?

I like load. Maybe hold off from doing too much work on commands until this discussion is resolved. Also note that there is another commands-PR (#590)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants