Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deftype support #27

Open
timowest opened this issue Feb 2, 2013 · 1 comment
Open

Add deftype support #27

timowest opened this issue Feb 2, 2013 · 1 comment

Comments

@timowest
Copy link
Owner

timowest commented Feb 2, 2013

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
Copy link
Owner Author

timowest commented Feb 3, 2013

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant