gen-class and need for fully qualified class names

41 views
Skip to first unread message

Jon Seltzer

unread,
Sep 30, 2021, 6:55:20 PM9/30/21
to clo...@googlegroups.com
Hi all,

I'm sure this is answered somewhere already but can't find it. The :gen-class option of ns macro has access to imports. Why is it that fully qualified class names are still required?

Elias Zaretsky

unread,
Oct 1, 2021, 8:42:09 AM10/1/21
to Clojure
Jon,

The ns macro is expanded such that the (gen-class) form appears before any (import) calls. So unqualified names are not available yet. There are more details in this StackOverflow answer I posted a while back.

Thanks,
Elias.
Reply all
Reply to author
Forward
0 new messages