Fix startup environment.

This commit is contained in:
Calvin Rose 2019-10-29 18:47:54 -05:00
parent 2541806dc1
commit 427b2638e0
3 changed files with 6 additions and 1 deletions

View File

@ -2,6 +2,8 @@
All notable changes to this project will be documented in this file.
## Unreleased
- Add `cli-main` function to the core, which invokes Janet's CLI interface.
This basically moves what was init.janet into boot.janet.
- Improve flychecking, and fix flyching bugs introduced in 1.4.0.
- Add `prin`, `eprint`, `eprintf` and `eprin` functions. The
functions prefix with e print to `(dyn :err stderr)`

View File

@ -88,7 +88,9 @@ int main(int argc, char **argv) {
Janet mainfun, out;
janet_resolve(env, janet_csymbol("cli-main"), &mainfun);
Janet mainargs[1] = { janet_wrap_array(args) };
status = janet_pcall(janet_unwrap_function(mainfun), 1, mainargs, &out, NULL);
JanetFiber *fiber = janet_fiber(janet_unwrap_function(mainfun), 64, 1, mainargs);
fiber->env = env;
status = janet_continue(fiber, janet_wrap_nil(), &out);
/* Deinitialize vm */
janet_deinit();

View File

@ -9,6 +9,7 @@
# Body
(each path (tuple/slice (dyn :args) 1)
(print "\n/* " path " */\n")
(print (slurp path)))
# maybe will help