diff --git a/c/libraries.c b/c/libraries.c index 65d9811..2940631 100644 --- a/c/libraries.c +++ b/c/libraries.c @@ -58,6 +58,7 @@ static struct builtin_procedure builtin_procedures[] = { { "string?", fl_stringp, SRFI_13 | R7RS_BASE | UP_2019 }, { "string-reverse", fl_string_reverse, SRFI_13 | UP_2019 }, + { "string-split", builtin_string_split, UP_2019 }, { "substring", fl_string_sub, R7RS_BASE | UP_2019 }, { "environment-stack", builtin_environment_stack, UP_2019 }, diff --git a/c/scheme.h b/c/scheme.h index 3d5ccc1..2f76223 100644 --- a/c/scheme.h +++ b/c/scheme.h @@ -1004,6 +1004,7 @@ value_t builtin_set_environment_variable(value_t *args, uint32_t nargs); value_t fl_stringp(value_t *args, uint32_t nargs); value_t fl_string_reverse(value_t *args, uint32_t nargs); +value_t builtin_string_split(value_t *args, uint32_t nargs); value_t fl_string_sub(value_t *args, uint32_t nargs); // util.c diff --git a/c/string.c b/c/string.c index 7cb8763..7a3e80e 100644 --- a/c/string.c +++ b/c/string.c @@ -162,16 +162,16 @@ value_t fl_string(value_t *args, uint32_t nargs) return outp; } -value_t fl_string_split(value_t *args, uint32_t nargs) +value_t builtin_string_split(value_t *args, uint32_t nargs) { char *s; char *delim; size_t len, dlen, ssz, tokend, tokstart, i, junk; value_t first, c, last; - argcount("string.split", nargs, 2); - s = tostring(args[0], "string.split"); - delim = tostring(args[1], "string.split"); + argcount("string-split", nargs, 2); + s = tostring(args[0], "string-split"); + delim = tostring(args[1], "string-split"); len = cv_len((struct cvalue *)ptr(args[0])); dlen = cv_len((struct cvalue *)ptr(args[1])); tokend = tokstart = i = 0; @@ -497,7 +497,6 @@ static struct builtinspec stringfunc_info[] = { { "string?", fl_stringp }, { "string.count", fl_string_count }, { "string.width", fl_string_width }, - { "string.split", fl_string_split }, { "string.sub", fl_string_sub }, { "string.find", fl_string_find }, { "string.char", fl_string_char },