Github Copilot Wants to Play Chess Instead of Code
So I asked it to do this:<p><pre><code>    # Evaluate a Lisp S-expression
    def eval_list(s):
</code></pre>
This was the third suggestion:<p><pre><code>    def eval_list(s):
        if not s:
            return None
        if len(s) == 1:
            return s[0]
        if s[0] == &#x27;quote&#x27;:
            return s[1]
        if s[0] == &#x27;if&#x27;:
            if eval_list(s[1]) != False:
                return eval_list(s[2])
            else:
                return eval_list(s[3])
        if s[0] == &#x27;set!&#x27;:
            if s[1] in env:
                env[s[1]] = eval_list(s[2])
                return s[2]
            else:
                raise Exception(&quot;{} is not defined&quot;.format(s[1]))
        if s[0] == &#x27;define&#x27;:
            if s[1] in env:
                raise Exception(&quot;{} is already defined&quot;.format(s[1]))
            env[s[1]] = eval_list(s[2])
            return s[2]
        if s[0] == &#x27;lambda&#x27;:
            return lambda *args: eval_list(s[2])
        if s[0] == &#x27;begin&#x27;:
            return eval_list(s[1:])
        if s[0] in env:
            return env[s[0]](eval_list(s[1:]))
        raise Exception(&quot;{} is not defined&quot;.format(s[0]))
</code></pre>
Huh! Now I&#x27;m wondering if it just lifted the snippet verbatim (sans identifiers), or...