@ambrosebs: I'm trying to use core.typed
with a project entirely written in .cljc files but when using check-ns
from the REPL it looks for a .clj file
and doesn't find it
I'm using the latest release (0.3.0)
is support for reader conditionals planned?
I'd be happy to help to push it forward
dialelo: would like to see support ASAP, please open a JIRA ticket.
dialelo: probably a one-liner change in clojure.core.typed.analyze-clj
help appreciated
I did some research and included what I found in the ticket
feel free to change its priority
I'm trying to write a patch ATM
dialelo: awesome.
should .cljc files have preference over .clj files?
not sure how Clojure behves when finding duplicated files with .cljc and .clj extension, does any of them have preference over the other?
dialelo: I think the logic is in the implementation of clojure.core/load
dialelo: somewhere in clojure.lang.RT
IIRC
the release notes for Clojure 1.7 says that the platform-specific file extension (.clj & .cljs) will be checked prior to .cljc
so I guess it makes sense for core.typed to have that same behaviour
dialelo: so both are checked?
*loaded
in RT.load, .clj files are tried first; if they are not found .cljc is tried
got it
yes copy that behaviour
great!
.cljc are effectively ignored if .clj is present?
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/RT.java#L421-424
looks like it, they are only checked after finding out that the .clj file doesn't exist
looks right
Oh interesting
I found out that 0.6.1 of tools.analyzer.jvm is used, .cljc support landed recently and I guess it will go in the next release (0.6.8)
the reader works well since it accepts a :read-cond :allow
option
but I'm getting exceptions from the analyzer due to not supporting .cljc in the version core.typed depends
dialelo: ah that makes sense
dialelo: there's a bit of work I need to do to update tools.analyzer
I understand, the patch for file resolution is quite trivial
it only affects how ns->file
works and the options passed to the reader
should I attach it to the ticket for the time being and update it when the tools.analyzer work is done?
(running out of battery, hope I can find a plug in #C04V12NPC)
sounds good
great, will attach as soon as I can plug my laptop
ambrosebs: thanks a lot for the patience and guidance :simple_smile:
thanks!