[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Re: bogus change(s) in cl-macs.el



    > (macroexpand
    >  '(labels ((FOO nil FOO-BODY)
    > 	   (BAR nil BAR-BODY))
    >     (FOO)
    >     (BAR)))

    > (let ((--cl---cl-var---- nil)
    >       (--cl---cl-var---- nil))
    >   (progn
    >     (progn
    >       (set '--cl---cl-var---- #'(lambda nil BAR-BODY))
    >       (set '--cl---cl-var---- #'(lambda nil FOO-BODY)))
    >     (funcall (symbol-value '--cl---cl-var----))
    >     (funcall (symbol-value '--cl---cl-var----))))

    > One of two functions FOO and BAR is disregarded as you see.

    Well, actually we can't see it here because you haven't used print-gensym
    to distinguish symbols with the same name.

Using print-gensym is the right way to print such code, but there is
some value in producing code that will run correctly (in most cases)
even if it is printed and read without using print-gensym.  Sure, if
you print it that way, there's a danger that a gensym might share the
name of some other symbol in the program, and cause incorrect
shadowing; but that will essentially never happen in practice.  It's
not an improvement when something that nearly always worked now nearly
always fails in an obscure way.

So I think it is better to continue using something that produces
different names, as gensym does.  It could be defined all the time in
Emacs, if that avoids some problems.