Skip to content

Keep repartee's variables and give each expression a value - #4

Merged
bbatsov merged 4 commits into
mainfrom
repartee-eval
Nov 7, 2026
Merged

bbatsov merged 4 commits into
mainfrom
repartee-eval

Conversation

@bbatsov

@bbatsov bbatsov commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

A session lost its variables as soon as an eval didn't use them, as evals ran with prune_binding. IEx doesn't prune. And an eval of several expressions sent only the last value, which proof's eval.multiple-forms check didn't catch because proof's repartee profile had no snippet for it. The expressions now run one at a time, like IEx does and like dialtone's Erlang backend runs forms, and a parenthesized block still counts as one expression.

An expression that fails keeps what the ones before it did, since the client already has their values. IEx drops it all, but it also shows only the last value.

Evals ran with prune_binding, which keeps only the variables the code
reads or writes, so after `x = 1` and `y = 2` the session no longer had
`x`. IEx doesn't prune either.
repartee evaluated the code of an eval as a single block and sent only
the last value, so a client sending `x = 1` and `x + 1` together lost
the first one. The expressions run one at a time now, like in IEx and
in dialtone's Erlang backend, and each one but the last sends its value
as it goes. A parenthesized block is still one expression, and
load-file still reports just the last value, like nREPL.
Each expression sends its value as it goes now, but one that raised
still took the session back to its state from before the eval, so after
`y = 1` and `raise "boom"` together the client had seen y's value and
couldn't use it. The expressions that ran keep what they did. IEx drops
it all, but IEx also shows only the last value.
The stdout and stderr tests had become single expressions so that they
got a single value. They're back to an expression after the output,
which also checks that values and output stay in order.
@bbatsov
bbatsov merged commit e6a3a1e into main Nov 7, 2026
10 checks passed
@bbatsov
bbatsov deleted the repartee-eval branch November 7, 2026 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant