JanetDocsSourcePlaygroundI'm feeling luckyCommunityGitHub sign in

load-image

core-api


    function
    boot.janet on line 2787, column 1

    (load-image image)

    The inverse operation to `make-image`. Returns an environment.


1 exampleSign in to add an example
Loading...
# To resume an image's environment:

# With this example image:
# echo "(def a 1)" > test.janet
# janet -c test.janet test.jimage
# Now open the REPL:

# To enter an image, for continued development or exploration. N.b. this does not work as expected:
# See: https://janet.zulipchat.com/#narrow/channel/409517-help/topic/Image.20Based.20Development.3F/with/529177765

(defn restore-image [image]
  (loop [[k v] :pairs image]
    (put (curenv) k v)))

(restore-image (load-image (slurp "test.jimage")))
veqqqPlayground