Re: Keyword implementation

Matthew Dempsky <[email protected]> 06 Jun 2004 13:35:47 -0500
Newsgroups gmane.lisp.scheme.pika.devel
Message-ID <[email protected]>
Andreas Rottmann <[email protected]> writes:

> OTOH, this would make keywords
> more heavyweight and EQ? will not work for them, so this is probably
> not a good idea. Thoughts?

Just a thought, we could add a boolean to the symbol object data for
whether it's a symbol or keyword.  To use this idea efficiently,
however, we'd probably need to change the hash table lookup for
symbols to store both a symbol and keyword for each string.

However, then SYMBOL->KEYWORD and KEYWORD->SYMBOL would either need
another lookup in the table, or we can add another element to the
vtable -- an scm object "other" that either points to null or the
result of SYMBOL->KEYWORD or KEYWORD->SYMBOL (as appropriate), though
the first time we call it we would still need to make a hash table
lookup.

Food for thought,
-jivera