Drop nil-valued keys from nREPL requests - #4186
Merged
Merged
Conversation
bbatsov
force-pushed
the
strip-nil-request-values
branch
2 times, most recently
from
September 10, 2026 08:42
ade61a2 to
50ac40d
Compare
Bencode has no nil, so a nil value in a request dict went out as an empty list. nREPL reads that as an explicit false for a couple of keys and as junk for the rest, so a caller that meant "not set" could end up binding *print-length* to [] or asking the printer for a [] margin. Drop nil-valued entries in the bencode dict encoder itself, so nested dicts (print options, queries, log filters) get the same treatment as the top-level request and every sender benefits without a wrapper. To keep a way to send an empty list on purpose, vectors now encode as bencode lists; the pr request plist uses [] for stream?, which is how nREPL spells "off" for that key. Settles the nil-vs-empty-list debate in #2362 as well.
bbatsov
force-pushed
the
strip-nil-request-values
branch
from
September 15, 2026 10:35
50ac40d to
538bfa1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A nil value in a request dict was bencoded as an empty list, which nREPL treats as an explicit false for some keys and as garbage for the rest. The encoder now leaves nil-valued entries out at any depth, and vectors encode as bencode lists so
[]remains available when an empty list is really meant (the pr request uses it forstream?).Fixes #2854
Closes #2362