Subject: Re: Avoiding unintentional variable capture
From: Erik Naggum <>
Date: 1999/09/14
Newsgroups: comp.lang.lisp
Message-ID: <>

* Thomas A. Russ
| I'm curious why you find COPY-SYMBOL better than GENSYM with an optional
| argument.  It would seem that if you ever have nested macros that use the
| same names, it would not be possible to distinguish the names produced by
| COPY-SYMBOL, since they would print the same.  At least with the GENSYMs,
| you can expect that two instances of #:COUNTER-4569 actually refer to the
| same variable.

  I think this is one of those problems that should not have a solution
  because the causes of the problem should be examined very carefully to
  avoid the problem altogether.  if you get into a situation where you need
  this sort of "control" often enough for it to be a real problem, you're
  probably doing something wrong.

  if I need such total disambiguation, I set *PRINT-CIRCLE* to true.  I
  also usually have *PRINT-GENSYM* set to false, but I'll happily let you
  know that I implemented both PRINT-CIRCLE and PRINT-GENSYM in GNU Emacs
  after I had implemented uninterned symbols for macro usage a few months
  earlier.  (all changes were accepted into the official distribution.)