Uh oh!
There was an error while loading. Please reload this page.
Add special local _ to store previously evaluated value - #422
Conversation
ko1
commented
Dec 14, 2021
I'm afraid to conflict with already existing parameter |
st0012
commented
Dec 14, 2021
I know this behavior. But from my experience, And if we do get an issue report for this behavior, I think it'd also happen in |
ko1
commented
Dec 17, 2021
I decided to postpone this feature.
Anyway, last value expression should be consistent with them. |
st0012
commented
Dec 18, 2021
Perhaps we can use the same approach for
I don't do concurrent programming often so I'm not sure what to expect in such case. But I imagine a shared value will be more complicated to manage than the current solution? If that's true, I'd go with the current approach and modify it when we receive more feedback.
I think it's a good idea. But I also hope to have |
ko1
commented
Dec 19, 2021
It is difficult to change such basic design. |
@ko1 ok, here's my plan to implement it:
Wdyt? |
096c4b5 to
de190bbCompareSpecs: - Like `irb`'s `_` variable, it stores the value returned by the previously evaluated expression in the REPL. - The default value is `nil`. - All the threads under the same session share the previously evaluated value. So when switching to other threads, you can use `_` to get the value returned by the previous thread. - If the previous evluation caused an exception, its result won't be stored.
de190bb to
25ef5fcComparest0012
commented
Jan 1, 2022
@ko1 I've addressed this 2 issues:
And regarding:
I think it could use more discussion and can be addressed in another PR. |
| end | ||
| @success_last_eval = true | ||
| event! :sync_prev_evaled, result |
There was a problem hiding this comment.
Please send SESSION's method. I'll make it.
st0012
commented
Mar 20, 2022
ko1
commented
Mar 20, 2022
Considering about this feature, there are same issues on multiple processes like ractors and we can not solve the issue.
For Q: I need to check other debuggers (and similar systems) |
st0012
commented
Apr 9, 2022
I don't have experience on debugging multi-process with a debugger, but I think it makes sense to not setting And regarding the implementation, I think we can use the same metadata/internal info approach I proposed in #503. So after an expression is evaluated, its value will be sent back to the |
ko1
commented
Apr 17, 2022
Could you survey other REPL/debuggers? |
Specs:
irb's_variable, it stores the value returned by thepreviously evaluated expression in the REPL.
nil.value. So when switching to other threads, you can use
_to get the valuereturned by the previous thread.