Skip to content

Need help understanding load-image #1274

Answered by CosmicToast
lc9er asked this question in Q&A
Discussion options

You must be logged in to vote

Images operate on environment tables (just like import), so you need to merge it in.
Example to save a repl:

(def a :a)
(curenv) # demo to show :a got defined
(spit "env" (make-image (curenv)))

Demo to load the state:

# merge with no prefix like with "use", do not re-export
(merge-module (curenv) (load-image (slurp "env")) "" false)
a # => :a

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@lc9er
Comment options

Answer selected by lc9er
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants