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

Can you access the result of evaluation in the REPL? #158

Open
danielmatz opened this issue Jul 12, 2024 · 3 comments
Open

Can you access the result of evaluation in the REPL? #158

danielmatz opened this issue Jul 12, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@danielmatz
Copy link
Contributor

After I call julia-snail-send-dwim, I sometimes want to play around with the resulting object in the REPL. It seems like that currently isn't possible. Is that right?

Is that something that could be added? Conceptually, it's a bit like the ans variable. I suppose one option is actually to bind ans to the result of the last evaluation. Or maybe there's a special JuliaSnail.result global that gets updated on each evaluation?

@gcv
Copy link
Owner

gcv commented Jul 13, 2024

I think it’s as simple as adding Base.MainInclude.ans = result to eval_tmpfile after line 261 (right before if isnothing(popup_params)). It seems to work for me, but I have not thoroughly tested it, nor am I certain that it doesn’t have bad side effects. Could you try making the change and drive it for a little while, and see if it seems safe to push to the main branch?

@gcv
Copy link
Owner

gcv commented Jul 13, 2024

Feel free to open a PR if there’s a better way to implement this feature.

@gcv gcv added the enhancement New feature or request label Jul 13, 2024
@danielmatz
Copy link
Contributor Author

Wow, it really was that easy to do! I'll give it a try for a while and report back. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants