symbol icon indicating copy to clipboard operation
symbol copied to clipboard

Add deftype support

Open timowest opened this issue 12 years ago • 1 comments

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))))

timowest avatar Feb 02 '13 17:02 timowest

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)

timowest avatar Feb 03 '13 12:02 timowest