1
0
mirror of https://github.com/janet-lang/janet synced 2025-11-14 22:37:12 +00:00

Move strtod to core, and rename parse-number, parse-integer, and

parse-real functions to scan-number, scan-integer, and scan-real.
Add very basic format function for formatting strings for printing.
This commit is contained in:
Calvin Rose
2018-05-01 11:06:31 -04:00
parent e4434f74b6
commit 1e4f221170
10 changed files with 114 additions and 64 deletions

View File

@@ -218,15 +218,20 @@ static int cfun_concat(DstArgs args) {
return dst_return(args, args.v[0]);
}
static const DstReg cfuns[] = {
{"array-pop", cfun_pop},
{"array-peek", cfun_peek},
{"array-push", cfun_push},
{"array-setcount", cfun_setcount},
{"array-ensure", cfun_ensure},
{"array-slice", cfun_slice},
{"array-concat", cfun_concat},
{NULL, NULL}
};
/* Load the array module */
int dst_lib_array(DstArgs args) {
DstTable *env = dst_env_arg(args);
dst_env_def(env, "array-pop", dst_wrap_cfunction(cfun_pop));
dst_env_def(env, "array-peek", dst_wrap_cfunction(cfun_peek));
dst_env_def(env, "array-push", dst_wrap_cfunction(cfun_push));
dst_env_def(env, "array-setcount", dst_wrap_cfunction(cfun_setcount));
dst_env_def(env, "array-ensure", dst_wrap_cfunction(cfun_ensure));
dst_env_def(env, "array-slice", dst_wrap_cfunction(cfun_slice));
dst_env_def(env, "array-concat", dst_wrap_cfunction(cfun_concat));
dst_env_cfuns(env, cfuns);
return 0;
}