The examples I've seen of main methods defined in clojure all use gen-class, together with (defn -main ...). Is it possible to define a class with an executable main method using deftype?
3
votes
2 Answers
8
votes
-1
votes
A main method only makes sense if you AOT compile it (with gen-class or similar).
If you tried to define it in any other way, then it wouldn't be possible to use it since you would need to launch the clojure compiler / environment first. So you'd have to start the app by calling some other main() method instead.....