[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: A different approach
felix winkelmann wrote:
On 7/19/05, Jens Axel Søgaard <jensaxel@xxxxxxxxxxxx> wrote:
Since some implementation do have uninterned symbols, it implies
that it isn't great style to rely on the above.
Well, I'm usually very careful with broad "isn't great style"
symbols do in fact complicate the (IMHO rather handy) assumption that
symbol->string and string->symbol 1:1 relationship. Gensyms are an
hack (used in 99% of all cases for "defmacro"-style macro programming). In fact,
I'd rather see a "(genguid)" than a "(gensym)" :-).
Well, I didn't say it was bad style - just that it isn't great style ;-)
The problem is that I've seen numerous bodies of code (object-systems,
module systems, ...) that depend on some kind of "symbol-append" function and
convert back and forth between symbols and strings. In these cases a
is required as uninterned symbols may lead to unexpected things.
To me uninterned symbols isn't as much an "implementation hack" as a
solution to a problem with the "symbol-append" approach.
If you want to generate a unique symbol it is unsafe to rely on
the symbol-append approach. It is possible to lower the probability
of clashes by using strange names, but one can't really be sure.
Jens Axel Søgaard