Node:Obarray Symbols, Next:, Previous:C Module Reg, Up:Deprecated

36.6 Obarray Symbol Manipulation

Guile's module mechanism uses obarrays, which are hash tables that map symbols to variables. Guile 1.4 included a group of primitives that could be used for the manipulation of the symbol-variable mappings in such obarrays.

However, considering the availability both of low-level procedures for operating on hash tables in general (see Hash Tables), and of a dedicated API for module-related operations (see Modules), the intermediate set of obarray primitives is no longer useful, and -- which is worse -- makes it more difficult to evolve the implementation of Guile's module system. Hence this set of primitives has now been deprecated.

If you have code using these functions, please change it to use either hash table or module-related operations.

gentemp [prefix [obarray]] Deprecated Scheme Procedure
scm_gentemp (prefix, obarray) Deprecated C Function
Create a new symbol with a name unique in an obarray. The name is constructed from an optional string prefix and a counter value. The default prefix is t. The obarray is specified as a second optional argument. Default is the system obarray where all normal symbols are interned. The counter is increased by 1 at each call. There is no provision for resetting the counter.

intern-symbol obarray string Deprecated Scheme Procedure
scm_intern_symbol (obarray, string) Deprecated C Function
Add a new symbol to obarray with name string, bound to an unspecified initial value. The symbol table is not modified if a symbol with this name is already present.

symbol-interned? obarray string Deprecated Scheme Procedure
scm_symbol_interned_p (obarray, string) Deprecated C Function
Return #t if obarray contains a symbol with name string, and #f otherwise.

unintern-symbol obarray string Deprecated Scheme Procedure
scm_unintern_symbol (obarray, string) Deprecated C Function
Remove the symbol with name string from obarray. This function returns #t if the symbol was present and #f otherwise.

string->obarray-symbol obarray string [soft?] Deprecated Scheme Procedure
scm_string_to_obarray_symbol (obarray, string, soft_p) Deprecated C Function
Intern a new symbol in obarray, a symbol table, with name string.

If obarray is #f, use the default system symbol table. If obarray is #t, the symbol should not be interned in any symbol table; merely return the pair (symbol . #<undefined>).

The soft? argument determines whether new symbol table entries should be created when the specified symbol is not already present in obarray. If soft? is specified and is a true value, then new entries should not be added for symbols not already present in the table; instead, simply return #f.

symbol-binding obarray string Deprecated Scheme Procedure
scm_symbol_binding (obarray, string) Deprecated C Function
Look up in obarray the symbol whose name is string, and return the value to which it is bound. If obarray is #f, use the global symbol table. If string is not interned in obarray, an error is signalled.

symbol-bound? obarray string Deprecated Scheme Procedure
scm_symbol_bound_p (obarray, string) Deprecated C Function
Return #t if obarray contains a symbol with name string bound to a defined value. This differs from symbol-interned? in that the mere mention of a symbol usually causes it to be interned; symbol-bound? determines whether a symbol has been given any meaningful value.

symbol-set! obarray string value Deprecated Scheme Procedure
scm_symbol_set_x (obarray, string, value) Deprecated C Function
Find the symbol in obarray whose name is string, and rebind it to value. An error is signalled if string is not present in obarray.

builtin-bindings Deprecated Scheme Procedure
scm_builtin_bindings Deprecated C Function
Create and return a copy of the global symbol table, removing all unbound symbols.