1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-28 11:09:54 +00:00

Add root-env

This makes images smaller without needing to make sure
that no references to the root environment occur in the final
image.
This commit is contained in:
Calvin Rose 2019-12-12 17:25:04 -06:00
parent 7c2ae45809
commit 5b9eda5e87
2 changed files with 6 additions and 2 deletions

View File

@ -31,6 +31,7 @@ All notable changes to this project will be documented in this file.
- Add `comptime` macro for compile time evaluation.
- Run `main` functions in scripts if they exist, just like jpm standalone binaries.
- Add `protect` macro.
- Add `root-env` to get the root environment table.
- Change marshalling protocol with regard to abstract types.
- Numerous small bug fixes and usability improvements.

View File

@ -2271,11 +2271,14 @@
###
###
(def root-env "The root environment used to create envionments with (make-env)" _env)
(do
(put _env 'boot/opts nil)
(put _env '_env nil)
(merge-into load-image-dict (env-lookup _env))
(merge-into make-image-dict (invert load-image-dict)))
(def load-dict (env-lookup _env))
(merge-into load-image-dict load-dict)
(merge-into make-image-dict (invert load-dict)))
###
###