Search code examples
hashtablecommon-lispunused-variables

What is "Unused variable G**** in anonymous function"?


I don't know if it is implementation dependent. Just in case it matters, I'm using Corman Lisp 3.0

When I do something like this:

(loop for v being the hash-values of *my-hash-table*
  when (> v 1) sum v)

I get two warnings:

;;; Warning: Unused variable G9063 in anonymous function
;;; Warning: Unused variable G9062 in anonymous function

With the number of G changing every time.

The result is correct though. What do they mean? Why do they appear? I suppose there might be some kind of loop syntax misuse, which leads to these warnings, but I fail to see it.


Solution

  • Corman Lisp hasn't been updated for years. The G* unused variables are probably gensyms in the macro expansion of loop. Try

    (macroexpand '(loop ...))
    

    to see what these variables store.