The BENCODING Common Lisp Library I like to imagine implementing BitTorrent one day and, albeit not in Common Lisp, the language still helps me to think about certain matters or details of implementation when using a language like Ada. The names for all functions naturally follow that name of the format, and I found no opportunity for creativity there. This implementation allows for extremely permissive encoding and decoding through the condition system, but it feels like a waste of effort; I've always disliked writing such code in Common Lisp, because there's no end to what can go wrong or the conveniences which can be added, and yet such code is never the proper solution to the problem of malformed data; specialized tools serve better, and the condition system code is mostly useless for writing them, because the whole system's organization should be fundamentally different for such a tool. A specialized tool benefits from an organization which enumerates all possible failures ahead of time and rigidly addresses them; I feel no need for the flexibility of the condition system in such an effort. I increasingly view parts of Common Lisp as ways to get some of the benefits of specialization with much less work, but see it as no way to approach the final solution to the problem. A tool such as Emacs is horribly insufficient from its focus on so-called text, and yet approaches solutions in ways I see Common Lisp never will. Defining custom conditions for this would've been overkill; the user is expected to use the CONTINUE or STORE-VALUE restarts if available, or to avoid the issue entirely and treat any error as damning. The Ada implementation I write will reject malformed data. This is truly the best way, for most any implementation does this anyway, and so little of the data will be malformed regardless. Rigid view and intolerance is the proper solution to machine data formats; ideally, more and more failure cases are eliminated in the design stage, until only inherent network failures remain. Bencoding involves parsing, but is reasonable in its form, and almost eliminates it. Regardless, this was fun to make. .