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

RE: '#:foobar versus (make-symbol "FOOBAR")



    From:      dmg@goldilocks.LCS.MIT.EDU
   
    In this case, it should be clear that
    using #: is more space efficient than using make-symbol, since
    use of distinct symbols for nested bindings is unnecessary.
    
I would be the last to suggest that programmers need not be very careful
about unneccessary consing.  However, in the case of macros, worrying
about generating a few extra uninterned symbols is a red herring.  The
uninterned symbols are only used to name local variables, which the
compiler will turn into references to stack locations.  The actual names
of the locals don't need to be saved, and most compilers are smart
enough not to save the names if they are uninterned symbols.  (Most
compilers do save the names of other locals which makes debugging much
easier.)

In this case, the cost of a few extra symbols at compile time is well
worth the added safety of truly unique names.

Kevin Gallagher