Run Length Encoding in Common Lisp
I was curious to generate Common Lisp code using ChatGPT and Claude for a simple problem and then compare the code. After thinking for while, I decided to use the “Run Length Encoding” problem for this experiment.
Here is the prompt I used:
“You are an experienced Common Lisp developer. Please write bug-free and elegant Lisp code for run-length encoding/decoding.”
Nothing fancy. To the point.
Here is the code generated by ChatGPT (model: GPT 5.6 Medium mode):

The following was generated by Claude (model: Opus 5.5 Medium mode):

You can see that ChapGPT’s code for encoding is slightly more verbose than Claude’s, but the decoding implementation is more compact. Such differences are expected even among human programmers, so no big deal. But what made me happy is the fact that both implementations worked the first time, without bugs! I think simplicity of the problem is the main reason for this.
Here is the output for different inputs:

I tested the programs in LispWorks Lisp ver 8.0. You can download the source here.