-
Notifications
You must be signed in to change notification settings - Fork 175
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
arglists in info op are problematic #25
Comments
I'm seeing other cases where nils in a response map are breaking elisp's expectations, clearly missing something fundamental :-). This serialized output: on the elisp side results in: |
Seems like bencode or the parser is to blame, will explore the ramifications of converting nils to empty-list. |
In Emacs Lisp an empty list and |
Not sure where the problem is, but here's a clue: Encoded message: Decoded message: The data gets cut off after arglists. |
I crafted a test case in clojure that roundtrips successfully, I think the blame is with the bdecode implementation in cider-client.el elisp:
Conflates nil/() for control-flow where it might be a valid encoded result. Seems like bencode could indeed encode an empty list with 'le'. Not sure if this is valid. |
The current implementation was mostly copy-pasted from the EmacsWiki (http://www.emacswiki.org/emacs-en/bencode.el) so it's quite possible there are bugs in it. I hope I'll be able to look into this soon myself, but I cannot make any promises. |
I'll debug it again as soon as I get a chance, I confirmed the issue, what follows is the new information we should take into account for arbitrary nested data structures (which I think would make life a lot easier in the long run): Bencode supports empty-list 'le', clojure impl can produce it from empty-vectors or lists, at the moment the elisp impl shorts on falsy, including empty-list. Here is my roundtrip function that I've been using to test this out:
|
Just confirmed all this with someone in the ##bittorrent freenode channel. The clojure impl seems to be doing the right thing in all these edge-cases.
|
[Fix #525] and clojure-emacs/cider-nrepl#25, bencode parser can handle n...
cider.nrepl.middleware.util.misc> (transform-value '([]))
(nil)
This ends up cutting off data on the elisp side after an arglists entry, which can include valuable file/line information. Should decide on a canonical representation, whether strings or lists of strings or so on.
The text was updated successfully, but these errors were encountered: