pika-dev
[Top][All Lists]
Advanced

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

[Pika-dev] Re: Keyword implementation


From: Tom Lord
Subject: [Pika-dev] Re: Keyword implementation
Date: Mon, 7 Jun 2004 10:07:20 -0700 (PDT)

    > From: Andreas Rottmann <address@hidden>

    > I just sat down to do a bit of work on keywords. I've now
    > implemented lexer support for R5RS-compatible keywords, and am
    > now thinking about how to best implement the data structure for
    > them. Would a one-slot vtable object, whose slot carries the
    > symbol corresponding to the keyword work? This way we can easily
    > reuse parts of the symbols implementation (e.g. interning), plus
    > KEYWORD->SYMBOL and SYMBOL->KEYWORD will be quite fast. OTOH,
    > this would make keywords more heavyweight and EQ? will not work
    > for them, so this is probably not a good idea. Thoughts?


My non-scientific opinion, based on my experience with keywords, is
that conversion to and from symbols is rarely needed.  It isn't
important for it to be fast.

On the other hand, keywords wind up being used in MEMQ calls and CASE
expressions often, so EQ? speed for keywords is very important.

-t





reply via email to

[Prev in Thread] Current Thread [Next in Thread]