Skip to content
This repository has been archived by the owner on Jun 4, 2022. It is now read-only.

load-file does not work inside eval context #449

Open
dundalek opened this issue Nov 9, 2018 · 2 comments
Open

load-file does not work inside eval context #449

dundalek opened this issue Nov 9, 2018 · 2 comments

Comments

@dundalek
Copy link

dundalek commented Nov 9, 2018

I have an example script.cljc with a following content:

(println "Loading script: OK!")

Running load-file in REPL works as expected:

Lumo 1.9.0
ClojureScript 1.10.439
Node.js v10.9.0
 Docs: (doc function-name-here)
       (find-doc "part-of-name-here")
 Source: (source function-name-here)
 Exit: Control+D or :cljs/quit or exit

cljs.user=> (load-file "script.cljc")
Loading script: OK!

However, it does not load inside eval:

cljs.user=> (eval '(load-file "script.cljc"))
nil

Interestingly lumo's internal execute-path works inside eval:

cljs.user=> (eval '(lumo.repl/execute-path "script.cljc" {}))
WARNING: var: lumo.repl/execute-path is not public
Loading script: OK!
nil

Would it be possible to make load-file work in eval context as well?

@anmonteiro
Copy link
Owner

Interesting. load-file is a "REPL special" form which only really works at the REPL. I suppose we didn't predict the case where it would have been called inside eval. Do you wanna work on a fix?

@dundalek
Copy link
Author

dundalek commented Nov 9, 2018

I would like to help out, but I am not sure where to look and what would be needed to change. Do you have any pointers?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants