In retrospect, it seems that binding variables to themselves, as in ( ?arg1 . ?arg1 ), was not such a good idea. It complicates the meaning of bindings, and prohibits us from using existing tools. For example, I had to use find-anywhere instead of occur-check for case 11, because occur-check expects a noncircular binding list. But fi n d-anywhere does not do as complete a job as occur – check. Write a version of compile – unify that returns three values: the code, a noncircular binding list, and a list of variables that are bound to unknown values.