pika-dev
[Top][All Lists]
Advanced

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

[Pika-dev] Re: Keyword implementation


From: Andreas Rottmann
Subject: [Pika-dev] Re: Keyword implementation
Date: Mon, 07 Jun 2004 19:46:43 +0200
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

Tom Lord <address@hidden> writes:

>     > 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.
>
I agree. My current approach is to "duplicate" the interning
infrastructure for keywords (i.e. have a keyword_table in struct
scm_gc_arena).

Andy
-- 
Andreas Rottmann         | address@hidden      | address@hidden | address@hidden
http://yi.org/rotty      | GnuPG Key: http://yi.org/rotty/gpg.asc
Fingerprint              | DFB4 4EB4 78A4 5EEE 6219  F228 F92F CFC5 01FD 5B62

Say NO to Software Patents! -- http://petition.eurolinux.org/




reply via email to

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