Open ikappaki opened 3 days ago
Interesting. NameError
s come from the Python VM. So probably the Basilisp compiler is ok with this snippet but emits Python code which makes a direct reference to the name TypeOther
rather than a namespaced reference.
I'll have to dig into this more when I have a minute.
Hi,
When trying to unquote a
deftype
defined in namespace B from namespace A in a macro, the following error occurs:NameError: name 'TypeOther' is not defined
To reproduce
other.lpy
file defining a new typeother.lpy
(deftype TypeOther [] (repr [this] "a"))
(TypeOther.)
issue
namespace, the above error is thrownThe same works in Clojure
other.clj
issue.clj
Note that to reference the deftype in Clojure, the other namespace must be both
:require
d and the type explicitly:importe
d.Encountered while trying to port the hiccup lib to Basilisp for fun in case you are wondering where the latest corner cases are coming from 😅. It goes well so far (praise to your hard work maintaining compatibility with Clojure 🙌), I can compile the lib fine, I'm currently running through the tests. Thanks for the latest fixes.