diff options
author | Andy Wingo <wingo@pobox.com> | 2010-08-08 14:15:47 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2010-08-08 14:15:47 +0200 |
commit | 8a4ed2dd34c86eb451c5555a85f64f3fbdf9cef6 (patch) | |
tree | 592132af4f874860a2202420842b0c9c24af2b2b | |
parent | 220058a8353815f2cefa67e2510b7132991cf7a7 (diff) | |
download | guile-8a4ed2dd34c86eb451c5555a85f64f3fbdf9cef6.tar.gz |
remove "discouraged" infrastructure
* libguile/discouraged.h: Remove.
* libguile/deprecated.c (scm_internal_select, scm_thread_sleep)
(scm_thread_usleep): Deprecate formerly discouraged names.
* libguile/eq.h (SCM_EQ_P):
* libguile/pairs.h (SCM_NULLP, SCM_NNULLP, SCM_CONSP, SCM_NCONSP):
* libguile/boolean.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOLP, SCM_BOOL):
(SCM_NEGATE_BOOL, SCM_BOOL_NOT): Undiscourage these names, because I'm
not sure deprecating them will do any good.
* libguile.h:
* libguile/gen-scmconfig.c:
* libguile/numbers.c:
* libguile/init.c:
* libguile/Makefile.am:
* configure.ac: Remove bits that referenced discouraged.h, and dealt
with the "discouraging" system.
-rw-r--r-- | configure.ac | 9 | ||||
-rw-r--r-- | libguile.h | 1 | ||||
-rw-r--r-- | libguile/Makefile.am | 1 | ||||
-rw-r--r-- | libguile/boolean.h | 14 | ||||
-rw-r--r-- | libguile/deprecated.c | 28 | ||||
-rw-r--r-- | libguile/deprecated.h | 8 | ||||
-rw-r--r-- | libguile/discouraged.h | 97 | ||||
-rw-r--r-- | libguile/eq.h | 9 | ||||
-rw-r--r-- | libguile/gen-scmconfig.c | 6 | ||||
-rw-r--r-- | libguile/init.c | 1 | ||||
-rw-r--r-- | libguile/numbers.c | 2 | ||||
-rw-r--r-- | libguile/pairs.h | 10 | ||||
-rw-r--r-- | libguile/symbols.h | 14 |
13 files changed, 77 insertions, 123 deletions
diff --git a/configure.ac b/configure.ac index 57ba8d6b6..aac492e37 100644 --- a/configure.ac +++ b/configure.ac @@ -130,15 +130,6 @@ AC_ARG_ENABLE(regex, [ --disable-regex omit regular expression interfaces],, enable_regex=yes) -AC_ARG_ENABLE([discouraged], - AS_HELP_STRING([--disable-discouraged],[omit discouraged features])) - -if test "$enable_discouraged" = no; then - SCM_I_GSC_ENABLE_DISCOURAGED=0 -else - SCM_I_GSC_ENABLE_DISCOURAGED=1 -fi - AC_ARG_ENABLE([deprecated], AS_HELP_STRING([--disable-deprecated],[omit deprecated features])) diff --git a/libguile.h b/libguile.h index 6f1b3f822..5e8c792bc 100644 --- a/libguile.h +++ b/libguile.h @@ -123,7 +123,6 @@ extern "C" { #include "libguile/threads.h" #include "libguile/inline.h" -#include "libguile/discouraged.h" #include "libguile/deprecated.h" #ifdef __cplusplus diff --git a/libguile/Makefile.am b/libguile/Makefile.am index dc9ce2635..3045075ec 100644 --- a/libguile/Makefile.am +++ b/libguile/Makefile.am @@ -487,7 +487,6 @@ modinclude_HEADERS = \ debug.h \ deprecated.h \ deprecation.h \ - discouraged.h \ dynl.h \ dynwind.h \ eq.h \ diff --git a/libguile/boolean.h b/libguile/boolean.h index 7084fdf29..8f55f1ee5 100644 --- a/libguile/boolean.h +++ b/libguile/boolean.h @@ -56,8 +56,7 @@ (SCM_MATCHES_BITS_IN_COMMON ((x), SCM_ELISP_NIL, SCM_BOOL_F)) #define scm_is_true_and_not_nil(x) (!scm_is_false_or_nil (x)) -/* -#nil is false. */ +/* #nil is false. */ #define scm_is_false(x) (scm_is_false_or_nil (x)) #define scm_is_true(x) (!scm_is_false (x)) @@ -91,6 +90,17 @@ SCM_API int scm_to_bool (SCM x); +/* Older spellings for the above routines, kept around for + compatibility. */ +#define SCM_FALSEP(x) (scm_is_false (x)) +#define SCM_NFALSEP(x) (scm_is_true (x)) +#define SCM_BOOLP(x) (scm_is_bool (x)) +#define SCM_BOOL(x) (scm_from_bool (x)) +#define SCM_NEGATE_BOOL(f) (scm_from_bool (!(f))) +#define SCM_BOOL_NOT(x) (scm_not (x)) + + + /* * The following macros efficiently implement boolean truth testing as * expected by most lisps, which treat '() aka SCM_EOL as false. diff --git a/libguile/deprecated.c b/libguile/deprecated.c index 75591524e..648efe9ac 100644 --- a/libguile/deprecated.c +++ b/libguile/deprecated.c @@ -34,7 +34,6 @@ #include "libguile/bytevectors.h" #include "libguile/bitvectors.h" #include "libguile/deprecated.h" -#include "libguile/discouraged.h" #include "libguile/deprecation.h" #include "libguile/snarf.h" #include "libguile/validate.h" @@ -2333,6 +2332,33 @@ scm_c_make_keyword (const char *s) return scm_from_locale_keyword (s); } +unsigned int +scm_thread_sleep (unsigned int t) +{ + scm_c_issue_deprecation_warning + ("`scm_thread_sleep' is deprecated. Use scm_std_sleep instead."); + return scm_std_sleep (t); +} + +unsigned long +scm_thread_usleep (unsigned long t) +{ + scm_c_issue_deprecation_warning + ("`scm_thread_usleep' is deprecated. Use scm_std_usleep instead."); + return scm_std_usleep (t); +} + +int scm_internal_select (int fds, + SELECT_TYPE *rfds, + SELECT_TYPE *wfds, + SELECT_TYPE *efds, + struct timeval *timeout) +{ + scm_c_issue_deprecation_warning + ("`scm_internal_select' is deprecated. Use scm_std_select instead."); + return scm_std_select (fds, rfds, wfds, efds, timeout); +} + void diff --git a/libguile/deprecated.h b/libguile/deprecated.h index a72baefd8..893523f20 100644 --- a/libguile/deprecated.h +++ b/libguile/deprecated.h @@ -27,6 +27,7 @@ #include "libguile/strings.h" #include "libguile/eval.h" #include "libguile/throw.h" +#include "libguile/iselect.h" #if (SCM_ENABLE_DEPRECATED == 1) @@ -727,6 +728,13 @@ SCM_DEPRECATED SCM scm_keyword_dash_symbol (SCM keyword); SCM_DEPRECATED SCM scm_c_make_keyword (const char *s); +SCM_DEPRECATED unsigned int scm_thread_sleep (unsigned int); +SCM_DEPRECATED unsigned long scm_thread_usleep (unsigned long); +SCM_DEPRECATED int scm_internal_select (int fds, + SELECT_TYPE *rfds, + SELECT_TYPE *wfds, + SELECT_TYPE *efds, + struct timeval *timeout); void scm_i_init_deprecated (void); diff --git a/libguile/discouraged.h b/libguile/discouraged.h deleted file mode 100644 index 716841fed..000000000 --- a/libguile/discouraged.h +++ /dev/null @@ -1,97 +0,0 @@ -/* This file contains definitions for discouraged features. When you - discourage something, move it here when that is feasible. - - A discouraged feature is one that shouldn't be used in new code - since we have a better alternative now. However, there is nothing - wrong with using the old feature, so it is OK to continue to use - it. - - Eventually, discouraged features can be deprecated since removing - them will make Guile simpler. -*/ - -#ifndef SCM_DISCOURAGED_H -#define SCM_DISCOURAGED_H - -/* Copyright (C) 2004, 2006, 2010 Free Software Foundation, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 3 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301 USA - */ - -#include "libguile/__scm.h" - -#if SCM_ENABLE_DISCOURAGED == 1 - -/* Discouraged because they do not follow the naming convention. That - is, they end in "P" but return a C boolean. Also, SCM_BOOLP - evaluates its argument twice. -*/ - -#define SCM_FALSEP scm_is_false -#define SCM_NFALSEP scm_is_true -#define SCM_BOOLP scm_is_bool -#define SCM_EQ_P scm_is_eq - - -/* Convert from a C boolean to a SCM boolean value */ -#define SCM_BOOL scm_from_bool - -/* Convert from a C boolean to a SCM boolean value and negate it */ -#define SCM_NEGATE_BOOL(f) scm_from_bool(!(f)) - -/* SCM_BOOL_NOT returns the other boolean. - * The order of ^s here is important for Borland C++ (!?!?!) - */ -#define SCM_BOOL_NOT(x) (SCM_PACK (SCM_UNPACK (x) \ - ^ (SCM_UNPACK (SCM_BOOL_T) \ - ^ SCM_UNPACK (SCM_BOOL_F)))) - -/* Discouraged because scm_is_symbol has a better name, - */ -#define SCM_SYMBOLP scm_is_symbol - -/* Discouraged because the alternatives have the better names. - */ -#define SCM_SYMBOL_FUNC scm_symbol_fref -#define SCM_SET_SYMBOL_FUNC scm_symbol_fset_x -#define SCM_SYMBOL_PROPS scm_symbol_pref -#define SCM_SET_SYMBOL_PROPS scm_symbol_pset_x - -/* Discouraged because there are better ways. - */ -#define SCM_SYMBOL_HASH scm_i_symbol_hash -#define SCM_SYMBOL_INTERNED_P(X) scm_i_symbol_is_interned - -/* Discouraged because they evaluated their arguments twice and/or - don't fit the naming scheme. -*/ - -#define SCM_CONSP(x) (scm_is_pair (x)) -#define SCM_NCONSP(x) (!SCM_CONSP (x)) -#define SCM_NULLP(x) (scm_is_null (x)) -#define SCM_NNULLP(x) (!scm_is_null (x)) - -/* Discouraged because the 'internal' and 'thread' moniker is - confusing. - */ - -#define scm_internal_select scm_std_select -#define scm_thread_sleep scm_std_sleep -#define scm_thread_usleep scm_std_usleep - -#endif /* SCM_ENABLE_DISCOURAGED == 1 */ - -#endif /* SCM_DISCOURAGED_H */ diff --git a/libguile/eq.h b/libguile/eq.h index 1aeb1c496..c09d6670b 100644 --- a/libguile/eq.h +++ b/libguile/eq.h @@ -3,7 +3,7 @@ #ifndef SCM_EQ_H #define SCM_EQ_H -/* Copyright (C) 1995,1996,2000, 2006, 2008 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996,2000, 2006, 2008, 2010 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -27,6 +27,13 @@ +/* scm_is_eq is defined in tags.h for some reason. */ + +/* An older spelling for scm_is_eq. */ +#define SCM_EQ_P(x,y) (scm_is_eq (x, y)) + + + SCM_API SCM scm_eq_p (SCM x, SCM y); SCM_API SCM scm_eqv_p (SCM x, SCM y); SCM_API SCM scm_equal_p (SCM x, SCM y); diff --git a/libguile/gen-scmconfig.c b/libguile/gen-scmconfig.c index 79a7d370e..73f847f58 100644 --- a/libguile/gen-scmconfig.c +++ b/libguile/gen-scmconfig.c @@ -218,12 +218,6 @@ main (int argc, char *argv[]) else pf ("/* #undef GUILE_DEBUG */\n"); - /*** SCM_ENABLE_DISCOURAGED (0 or 1) ***/ - pf ("\n"); - pf ("/* Set to 1 if you want to enable discouraged features. */\n"); - pf ("/* (value will be 0 or 1). */\n"); - pf ("#define SCM_ENABLE_DISCOURAGED %d\n", SCM_I_GSC_ENABLE_DISCOURAGED); - /*** SCM_ENABLE_DEPRECATED (0 or 1) ***/ pf ("\n"); pf ("/* Set to 1 if you want to enable deprecated features. */\n"); diff --git a/libguile/init.c b/libguile/init.c index 126aa05bc..b511aae76 100644 --- a/libguile/init.c +++ b/libguile/init.c @@ -134,7 +134,6 @@ #include "libguile/extensions.h" #include "libguile/uniform.h" #include "libguile/srfi-4.h" -#include "libguile/discouraged.h" #include "libguile/deprecated.h" #include "libguile/init.h" diff --git a/libguile/numbers.c b/libguile/numbers.c index f60cca998..6f04ea5f0 100644 --- a/libguile/numbers.c +++ b/libguile/numbers.c @@ -67,8 +67,6 @@ #include "libguile/eq.h" -#include "libguile/discouraged.h" - /* values per glibc, if not already defined */ #ifndef M_LOG10E #define M_LOG10E 0.43429448190325182765 diff --git a/libguile/pairs.h b/libguile/pairs.h index 0e9816227..6edfc9c3e 100644 --- a/libguile/pairs.h +++ b/libguile/pairs.h @@ -56,11 +56,19 @@ (SCM_MATCHES_BITS_IN_COMMON ((x), SCM_ELISP_NIL, SCM_EOL)) -/* Older spellings for these nil predicates. */ + + +/* Older spellings for these null, nil, and pair predicates. */ #define SCM_NILP(x) (scm_is_eq ((x), SCM_ELISP_NIL)) #define SCM_NULL_OR_NIL_P(x) (scm_is_null_or_nil (x)) +#define SCM_NULLP(x) (scm_is_null (x)) +#define SCM_NNULLP(x) (!scm_is_null (x)) +#define SCM_CONSP(x) (scm_is_pair (x)) +#define SCM_NCONSP(x) (!SCM_CONSP (x)) + + /* #nil is null. */ #define scm_is_null(x) (scm_is_null_or_nil(x)) diff --git a/libguile/symbols.h b/libguile/symbols.h index e4bc33391..8f96d65e5 100644 --- a/libguile/symbols.h +++ b/libguile/symbols.h @@ -3,7 +3,7 @@ #ifndef SCM_SYMBOLS_H #define SCM_SYMBOLS_H -/* Copyright (C) 1995,1996,1997,1998,2000,2001, 2003, 2004, 2006, 2008 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996,1997,1998,2000,2001, 2003, 2004, 2006, 2008, 2010 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -36,6 +36,18 @@ +/* Older spellings; don't use in new code. + */ +#define SCM_SYMBOLP(x) (scm_is_symbol (x)) +#define SCM_SYMBOL_FUNC(x) (scm_symbol_fref (x)) +#define SCM_SET_SYMBOL_FUNC(x,f) (scm_symbol_fset_x (x, f)) +#define SCM_SYMBOL_PROPS(x) (scm_symbol_pref (x)) +#define SCM_SET_SYMBOL_PROPS(x,p) (scm_symbol_pset_x (x, p)) +#define SCM_SYMBOL_HASH(x) (scm_i_symbol_hash (x)) +#define SCM_SYMBOL_INTERNED_P(x) (scm_i_symbol_is_interned (x)) + + + #ifdef GUILE_DEBUG SCM_API SCM scm_sys_symbols (void); #endif |