HyREPL
HyREPL copied to clipboard
Fix bug in `bencode.decode-list` where decoding fails for empty list
In the case of an empty list, the thing to decode is the byte array [b'l', b'e'], i.e. the
list marker "l" followed immediately by the end marker "e".
Previously, we would incorrectly attempt to decode the end marker in this case.
We should make the end marker detection part of the while condition so that
the return value will be an empty list and the rest of the input will be
correctly decoded.
In particular, this resulted in an error any time I tried to evaluate an expression using cider (version 1.2.0snapshot)