diff options
author | Ludovic Courtès <ludo@gnu.org> | 2022-02-04 10:41:44 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2022-02-04 11:12:28 +0100 |
commit | 8e2e2ceb1745620bef318fc403b6dea2c590f318 (patch) | |
tree | ecb04e47f3dcbe0e552f263b780546e90eb5268e /libguile/symbols.c | |
parent | 2ebf0397075d6a557f18e45c9b0ed824be68808e (diff) | |
download | guile-8e2e2ceb1745620bef318fc403b6dea2c590f318.tar.gz |
Deprecate symbol properties.
* libguile/strings.c (scm_i_make_symbol): Remove 'props' argument. Use
3 words instead of 'scm_double_cell'.
* libguile/strings.h: Adjust accordingly.
* libguile/symbols.c (scm_i_str2symbol, scm_i_str2uninterned_symbol):
Likewise.
(scm_symbol_fref, scm_symbol_pref, scm_symbol_fset_x,
scm_symbol_pset_x): Move to...
* libguile/deprecated.c: ... here. Rewrite in terms of object
properties.
(symbol_function_slot, symbol_property_slot): New variables.
* libguile/symbols.h (SCM_SYMBOL_FUNC, SCM_SET_SYMBOL_FUNC)
(SCM_SYMBOL_PROPS, SCM_SET_SYMBOL_PROPS)
(scm_symbol_fref, scm_symbol_pref, scm_symbol_fset_x)
(scm_symbol_pset_x): Move to...
* libguile/deprecated.h: ... here. Mark declarations as 'SCM_DEPRECATED'.
* module/system/base/types.scm (cell->object): Remove 'props' field for
%TC7-SYMBOL.
* doc/ref/api-data.texi (Symbol Props): Remove.
* NEWS: Update.
Diffstat (limited to 'libguile/symbols.c')
-rw-r--r-- | libguile/symbols.c | 54 |
1 files changed, 3 insertions, 51 deletions
diff --git a/libguile/symbols.c b/libguile/symbols.c index b9d575778..02be7c1c4 100644 --- a/libguile/symbols.c +++ b/libguile/symbols.c @@ -1,4 +1,4 @@ -/* Copyright 1995-1998,2000-2001,2003-2004,2006,2009,2011,2013,2015,2018 +/* Copyright 1995-1998,2000-2001,2003-2004,2006,2009,2011,2013,2015,2018,2022 Free Software Foundation, Inc. This file is part of Guile. @@ -247,8 +247,7 @@ scm_i_str2symbol (SCM str) else { /* The symbol was not found, create it. */ - symbol = scm_i_make_symbol (str, 0, raw_hash, - scm_cons (SCM_BOOL_F, SCM_EOL)); + symbol = scm_i_make_symbol (str, 0, raw_hash); /* Might return a different symbol, if another one was interned at the same time. */ @@ -264,8 +263,7 @@ scm_i_str2uninterned_symbol (SCM str) { size_t raw_hash = scm_i_string_hash (str); - return scm_i_make_symbol (str, SCM_I_F_SYMBOL_UNINTERNED, - raw_hash, scm_cons (SCM_BOOL_F, SCM_EOL)); + return scm_i_make_symbol (str, SCM_I_F_SYMBOL_UNINTERNED, raw_hash); } SCM_DEFINE (scm_symbol_p, "symbol?", 1, 0, 0, @@ -421,52 +419,6 @@ SCM_DEFINE (scm_symbol_hash, "symbol-hash", 1, 0, 0, } #undef FUNC_NAME -SCM_DEFINE (scm_symbol_fref, "symbol-fref", 1, 0, 0, - (SCM s), - "Return the contents of the symbol @var{s}'s @dfn{function slot}.") -#define FUNC_NAME s_scm_symbol_fref -{ - SCM_VALIDATE_SYMBOL (1, s); - return SCM_CAR (SCM_CELL_OBJECT_3 (s)); -} -#undef FUNC_NAME - - -SCM_DEFINE (scm_symbol_pref, "symbol-pref", 1, 0, 0, - (SCM s), - "Return the @dfn{property list} currently associated with the\n" - "symbol @var{s}.") -#define FUNC_NAME s_scm_symbol_pref -{ - SCM_VALIDATE_SYMBOL (1, s); - return SCM_CDR (SCM_CELL_OBJECT_3 (s)); -} -#undef FUNC_NAME - - -SCM_DEFINE (scm_symbol_fset_x, "symbol-fset!", 2, 0, 0, - (SCM s, SCM val), - "Change the binding of the symbol @var{s}'s function slot.") -#define FUNC_NAME s_scm_symbol_fset_x -{ - SCM_VALIDATE_SYMBOL (1, s); - scm_set_car_x (SCM_CELL_OBJECT_3 (s), val); - return SCM_UNSPECIFIED; -} -#undef FUNC_NAME - - -SCM_DEFINE (scm_symbol_pset_x, "symbol-pset!", 2, 0, 0, - (SCM s, SCM val), - "Change the binding of the symbol @var{s}'s property slot.") -#define FUNC_NAME s_scm_symbol_pset_x -{ - SCM_VALIDATE_SYMBOL (1, s); - scm_set_cdr_x (SCM_CELL_OBJECT_3 (s), val); - return SCM_UNSPECIFIED; -} -#undef FUNC_NAME - SCM scm_from_locale_symbol (const char *sym) { |