diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2012-01-11 08:11:43 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2012-01-11 08:11:43 -0800 |
commit | 285cf6a287d4d2de7d02bb1d72f369226e19c213 (patch) | |
tree | a127dfa2b9f2b7ba960538915b9f5d50914be7f3 | |
parent | 54599a32a30ee276e4a26b20049ac2c79b6057c9 (diff) | |
download | txr-285cf6a287d4d2de7d02bb1d72f369226e19c213.tar.gz txr-285cf6a287d4d2de7d02bb1d72f369226e19c213.tar.bz2 txr-285cf6a287d4d2de7d02bb1d72f369226e19c213.zip |
* eval.c (eval_init): list_str registered.
* lib.c (list_str): New function.
* lib.h (list_str): Declared.
* txr.1: Doc stub section created.
* txr.vim: Updated.
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | eval.c | 1 | ||||
-rw-r--r-- | lib.c | 9 | ||||
-rw-r--r-- | lib.h | 1 | ||||
-rw-r--r-- | txr.1 | 2 | ||||
-rw-r--r-- | txr.vim | 3 |
6 files changed, 27 insertions, 1 deletions
@@ -1,3 +1,15 @@ +2012-01-11 Kaz Kylheku <kaz@kylheku.com> + + * eval.c (eval_init): list_str registered. + + * lib.c (list_str): New function. + + * lib.h (list_str): Declared. + + * txr.1: Doc stub section created. + + * txr.vim: Updated. + 2012-01-10 Kaz Kylheku <kaz@kylheku.com> * eval.c (generate): Bugfix: do not call gen_fun before @@ -1608,6 +1608,7 @@ void eval_init(void) reg_fun(intern(lit("cat-str"), user_package), func_n2(cat_str)); reg_fun(intern(lit("split-str"), user_package), func_n2(split_str)); reg_fun(intern(lit("split-str-set"), user_package), func_n2(split_str_set)); + reg_fun(intern(lit("list-str"), user_package), func_n1(list_str)); reg_fun(intern(lit("trim-str"), user_package), func_n1(trim_str)); reg_fun(intern(lit("string-lt"), user_package), func_n2(string_lt)); reg_fun(intern(lit("int-str"), user_package), func_n2(int_str)); @@ -1463,6 +1463,15 @@ val split_str_set(val str, val set) return out; } +val list_str(val str) +{ + const wchar_t *cstr = c_str(str); + list_collect_decl (out, iter); + while (*cstr) + list_collect(iter, chr(*cstr++)); + return out; +} + val trim_str(val str) { const wchar_t *start = c_str(str); @@ -420,6 +420,7 @@ val sub_str(val str_in, val from_num, val to_num); val cat_str(val list, val sep); val split_str(val str, val sep); val split_str_set(val str, val set); +val list_str(val str); val trim_str(val str); val string_lt(val astr, val bstr); val int_str(val str, val base); @@ -6058,6 +6058,8 @@ Certain object types have a custom equal function. .SS Function split-str-set +.SS Function list-str + .SS Function trim-str .SS Function string-lt @@ -59,7 +59,8 @@ syn keyword txl_keyword contained make-sym gensym *gensym-counter* make-package syn keyword txl_keyword contained intern symbolp symbol-name symbol-package keywordp syn keyword txl_keyword contained mkstring copy-str upcase-str downcase-str string-extend syn keyword txl_keyword contained stringp lazy-stringp length-str search-str search-str-tree -syn keyword txl_keyword contained sub-str cat-str split-str split-str-set trim-str +syn keyword txl_keyword contained sub-str cat-str split-str +syn keyword txl_keyword contained split-str-set list-str trim-str syn keyword txl_keyword contained string-lt int-str chrp chr-isalnum chr-isalpha syn keyword txl_keyword contained chr-isascii chr-iscntrl chr-isdigit chr-isgraph syn keyword txl_keyword contained chr-islower chr-isprint chr-ispunct chr-isspace chr-isupper |