eval-string in a jpm binary #1464
Unanswered
evanfarrar
asked this question in
Q&A
Replies: 1 comment
-
Does this help? (def hello-world "heyheyhey")
(def ce (curenv))
(defn main [&]
(print (eval-string "hello-world" ce))) I think the above was inspired by the coverage of compilation in this chapter of @ianthehenry's book. At least, that's what my subconscious seems to be saying (^^; Perhaps there is a better way though. Note that |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Can anyone explain to me why
eval-string
gives me an errorerror: unknown symbol hello-world
when running this jpm built executable?I can get it to work in a REPL, but not in a jpm executable. At first I thought the unused symbols were dropped out by tree-shaking, but I do see "heyheyhey" in the generated c code; I've tried a few other ways to ensure the symbol is available at runtime (such as defining it in the main function or explicitly referencing it) but no such luck. I don't know that I need it work, but I'm curious to understand it. Metaprogramming and compilation to compact native binaries are chocolate and peanut butter, I can't imagine not trying to use two great things together in the future.
Beta Was this translation helpful? Give feedback.
All reactions