[Top][All Lists]

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

Re: Release 1.6 critical TODO items.

From: Marius Vollmer
Subject: Re: Release 1.6 critical TODO items.
Date: 28 Jan 2002 23:16:08 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

Martin Grabmueller <address@hidden> writes:

> scm_mem2uninterned_symbol (const char *name, size_t len)
> {
>   size_t raw_hash = scm_string_hash ((const unsigned char *) name, len);
>   size_t hash = raw_hash % SCM_VECTOR_LENGTH (symbols);
>   {
>     SCM symbol;
>     SCM cell;
>     SCM_NEWCELL2 (symbol);
>     SCM_SET_SYMBOL_CHARS (symbol, scm_must_strndup (name, len));
>     SCM_SET_SYMBOL_HASH (symbol, raw_hash);
>     SCM_SET_PROP_SLOTS (symbol, scm_cons (SCM_BOOL_F, SCM_EOL));
>     SCM_SET_SYMBOL_LENGTH (symbol, (long) len);
>     return symbol;
>   }
> }
> Then this would be used in `scm_gensym' instead of `scm_mem2symbol'.
> Symbols created with would then be unique.

Yes, let's implement this.

What about using a special hash value to identify uninterned symbols?
This would be needed when printing them, for example, and it will be
faster than looking them up in 'symbols'.

reply via email to

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