Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Referred vars in a namespace are only available after a (load-file) #48

Open
tomjakubowski opened this issue Feb 16, 2015 · 3 comments
Open
Labels

Comments

@tomjakubowski
Copy link
Collaborator

To reproduce:

  • Run lein cljsbuild once in the example project.
  • Open a REPL in the example project.
  • Open index.html in a browser.
  • Switch to the weasel-example.example NS, and evaluate baz.

The referred var will not be available.

Then, run (load-file "weasel_example/example.cljs"), and try to evaluate baz again. The referred var will be available, and its value will be printed.

@swannodette
Copy link
Contributor

Technically I would not consider this a bug, but you may wish to preserve pre-existing behavior. You will need to analyze a source directory for these things to be available, :cache-analysis will definitely help here if you want to incur small overheads.

@mfikes
Copy link
Contributor

mfikes commented Mar 3, 2015

@tomjakubowski FWIW, Ambly exhibits what appears to be similar behavior. You can see this in the README.md instructions for Shrimp (where a require is used in lieu of a load-file to the same effect).

I actually get a WARNING: Use of undeclared Var but with things actually working, unless a require or load-file is first issued. (That's why I said similar behavior. If this is also what you are seeing then it is identical behavior.)

I found that issuing a repl/analyze-source call fixes this, but introduces the challenges I mentioned in #28 where there doesn't appear to be a way to programatically enumerate the source directories that need to be analyzed, and even if it were possible (say by introducing yet another :source-paths), they would need to be in a topological sort reflecting the dependency relation between the source directories.

@MalloZup
Copy link

MalloZup commented Aug 5, 2019

autogenerated with https://github.com/MalloZup/doghub: issue inactive since 450 days. Please update the issue or close it

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

No branches or pull requests

4 participants