diff options
author | Marius Vollmer <mvo@zagadka.de> | 2004-08-24 22:13:27 +0000 |
---|---|---|
committer | Marius Vollmer <mvo@zagadka.de> | 2004-08-24 22:13:27 +0000 |
commit | 1206efbe073b709bd61fa1cea90f058c45119efd (patch) | |
tree | 1b24386b274c0f945d63ab182b51601e91f55eed | |
parent | 2c0b7c1fa0dc4760418133b9eeebc0561a2dd4e0 (diff) | |
download | guile-1206efbe073b709bd61fa1cea90f058c45119efd.tar.gz |
* symbols.h, symbols.c (scm_string_ci_to_symbol): Moved here, next
to scm_string_to_symbol.
* deprecated.c, load.c, posix.c, unif.c, symbols.c: Include
"srfi-13.h" instead of "strop.h".
-rw-r--r-- | libguile/symbols.c | 15 | ||||
-rw-r--r-- | libguile/symbols.h | 1 |
2 files changed, 16 insertions, 0 deletions
diff --git a/libguile/symbols.c b/libguile/symbols.c index 657723cc6..375ce8cf7 100644 --- a/libguile/symbols.c +++ b/libguile/symbols.c @@ -34,6 +34,8 @@ #include "libguile/hashtab.h" #include "libguile/weaks.h" #include "libguile/modules.h" +#include "libguile/read.h" +#include "libguile/srfi-13.h" #include "libguile/validate.h" #include "libguile/symbols.h" @@ -245,6 +247,19 @@ SCM_DEFINE (scm_string_to_symbol, "string->symbol", 1, 0, 0, } #undef FUNC_NAME +SCM_DEFINE (scm_string_ci_to_symbol, "string-ci->symbol", 1, 0, 0, + (SCM str), + "Return the symbol whose name is @var{str}. @var{str} is\n" + "converted to lowercase before the conversion is done, if Guile\n" + "is currently reading symbols case-insensitively.") +#define FUNC_NAME s_scm_string_ci_to_symbol +{ + return scm_string_to_symbol (SCM_CASE_INSENSITIVE_P + ? scm_string_downcase(str) + : str); +} +#undef FUNC_NAME + #define MAX_PREFIX_LENGTH 30 SCM_DEFINE (scm_gensym, "gensym", 0, 1, 0, diff --git a/libguile/symbols.h b/libguile/symbols.h index a96d786e9..84a8df1f7 100644 --- a/libguile/symbols.h +++ b/libguile/symbols.h @@ -41,6 +41,7 @@ SCM_API SCM scm_symbol_interned_p (SCM sym); SCM_API SCM scm_make_symbol (SCM name); SCM_API SCM scm_symbol_to_string (SCM s); SCM_API SCM scm_string_to_symbol (SCM s); +SCM_API SCM scm_string_ci_to_symbol (SCM s); SCM_API SCM scm_symbol_fref (SCM s); SCM_API SCM scm_symbol_pref (SCM s); |