diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-02-26 07:33:19 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-02-26 07:33:19 -0800 |
commit | 1521adde660652f214be2b8f2811db0c2a0339d2 (patch) | |
tree | 6dee44f116227de5ee76e66b4125f256d3e9391b | |
parent | 92ce6b7cf1cd8bd573ed1c796fff21a17e2ccd64 (diff) | |
download | txr-1521adde660652f214be2b8f2811db0c2a0339d2.tar.gz txr-1521adde660652f214be2b8f2811db0c2a0339d2.tar.bz2 txr-1521adde660652f214be2b8f2811db0c2a0339d2.zip |
* lib.c (lit_s): New symbol.
(code2type): Return lit_s for LIT type.
(typeof): Return lit_s for TAG_LIT.
(replace_str): Error message wording.
(obj_init): lit_s interned.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | lib.c | 13 |
2 files changed, 16 insertions, 5 deletions
@@ -1,5 +1,13 @@ 2014-02-26 Kaz Kylheku <kaz@kylheku.com> + * lib.c (lit_s): New symbol. + (code2type): Return lit_s for LIT type. + (typeof): Return lit_s for TAG_LIT. + (replace_str): Error message wording. + (obj_init): lit_s interned. + +2014-02-26 Kaz Kylheku <kaz@kylheku.com> + * eval.c (do_eval): Set last_form_evaled just before dispatching function, so it is not clobbered by argument evaluations. @@ -69,7 +69,7 @@ val packages; val system_package, keyword_package, user_package; val null_s, t, cons_s, str_s, chr_s, fixnum_s, sym_s, pkg_s, fun_s, vec_s; -val stream_s, hash_s, hash_iter_s, lcons_s, lstr_s, cobj_s, cptr_s; +val lit_s, stream_s, hash_s, hash_iter_s, lcons_s, lstr_s, cobj_s, cptr_s; val env_s, bignum_s, float_s; val var_s, expr_s, regex_s, chset_s, set_s, cset_s, wild_s, oneplus_s; val nongreedy_s, compiled_regex_s; @@ -113,7 +113,7 @@ static val code2type(int code) case NIL: return null_s; case CONS: return cons_s; case STR: return str_s; - case LIT: return str_s; + case LIT: return lit_s; case CHR: return chr_s; case NUM: return fixnum_s; case SYM: return sym_s; @@ -138,7 +138,7 @@ val typeof(val obj) case TAG_CHR: return chr_s; case TAG_LIT: - return str_s; + return lit_s; case TAG_PTR: { int typecode = type(obj); @@ -2127,9 +2127,11 @@ val replace_str(val str_in, val items, val from, val to) val len_it = length(itseq); val len_rep; - if (type(str_in) != STR) - uw_throwf(error_s, lit("replace-str: string ~s of type ~s not supported"), + if (type(str_in) != STR) { + uw_throwf(error_s, lit("replace-str: ~s of type ~s is not " + "a modifiable string"), str_in, typeof(str_in), nao); + } if (null_or_missing_p(from)) from = zero; @@ -5072,6 +5074,7 @@ static void obj_init(void) null_s = intern(lit("null"), user_package); cons_s = intern(lit("cons"), user_package); str_s = intern(lit("str"), user_package); + lit_s = intern(lit("lit"), user_package); chr_s = intern(lit("chr"), user_package); fixnum_s = intern(lit("fixnum"), user_package); sym_s = intern(lit("sym"), user_package); |