symbol
symbol copied to clipboard
Add deftype support
A subset of Clojure's deftype constructs could be supported
(deftype <name> <columns vector> & <functions>)
e.g.
(deftype Person [contents]
; clojure.lang.IPersistentMap (no implements declarations for the moment)
(assoc [_ k v] (Person. (.assoc contents k v)))
(assocEx [_ k v] (Person. (.assocEx contents k v)))
(without [_ k] (Person. (.without contents k))))
As generic classes can't be properly modeled using the current approach, they might need to be put into the struct list:
(struct <name> <generics> <members>)
and for generic types usage will also need to be encoded like this
(TypeName & generics)