diff options
author | Marius Vollmer <mvo@zagadka.de> | 2002-02-03 22:49:06 +0000 |
---|---|---|
committer | Marius Vollmer <mvo@zagadka.de> | 2002-02-03 22:49:06 +0000 |
commit | ac48757b5ed4efeb2b7018c8e08ea26cab8a5418 (patch) | |
tree | d0d3acebc2eb23feed600255073f8ab0abb7175c /libguile/symbols.h | |
parent | e3f394f39164d1b8f84b4b3187cde04e968aea13 (diff) | |
download | guile-ac48757b5ed4efeb2b7018c8e08ea26cab8a5418.tar.gz |
* symbols.h (SCM_SET_SYMBOL_HASH): Removed.
(SCM_SYMBOL_INTERNED_P): New.
* symbols.c (scm_symbol_hash): Use scm_ulong2num instead of
SCM_MAKINUM since hash values can well be bignums.
(scm_mem2symbol): Only use hash values below SCM_T_BITS_MAX/2.
This signals a interned symbol.
(scm_mem2uninterned_symbol, scm_symbol_interned_p,
scm_make_symbol): New.
Diffstat (limited to 'libguile/symbols.h')
-rw-r--r-- | libguile/symbols.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libguile/symbols.h b/libguile/symbols.h index e4c624801..771d9ecab 100644 --- a/libguile/symbols.h +++ b/libguile/symbols.h @@ -51,6 +51,10 @@ /* SCM_SYMBOL_LENGTH(SYM) is the length of SYM's name in characters, and * SCM_SYMBOL_CHARS(SYM) is the address of the first character of SYM's name. + * + * SCM_SYMBOL_HASH is a hash value for the symbol. It is also used to + * encode whether the symbol is interned or not. See + * SCM_SYMBOL_INTERNED_P. */ #define SCM_SYMBOLP(x) (!SCM_IMP (x) && (SCM_TYP7 (x) == scm_tc7_symbol)) @@ -60,7 +64,7 @@ #define SCM_SYMBOL_CHARS(x) ((char *) (SCM_CELL_WORD_1 (x))) #define SCM_SET_SYMBOL_CHARS(s, c) (SCM_SET_CELL_WORD_1 ((s), (c))) #define SCM_SYMBOL_HASH(X) ((unsigned long) SCM_CELL_WORD_2 (X)) -#define SCM_SET_SYMBOL_HASH(X, v) (SCM_SET_CELL_WORD_2 ((X), (v))) +#define SCM_SYMBOL_INTERNED_P(X) (SCM_SYMBOL_HASH(X) <= (SCM_T_BITS_MAX/2)) #define SCM_PROP_SLOTS(X) (SCM_CELL_OBJECT_3 (X)) #define SCM_SET_PROP_SLOTS(X, v) (SCM_SET_CELL_OBJECT_3 ((X), (v))) |