deftype introspection?

3 views
Skip to first unread message

Allen Rohner

unread,
Dec 1, 2009, 12:32:24 AM12/1/09
to Clojure Dev
I needed a good way to introspect the fields on an instance of a class
created by deftype, so I wrote a simple little function to do it. I
created a new multimethod, deftype-fields, and then made each call to
deftype call defmulti with the type just created, similar to how
deftype calls print-method now.

You can see the code http://github.com/arohner/clojure/commit/8de6d72ca74f4910448791e1a5487bc30995e494

Rich, do you agree this is a worthwhile problem? Is this a good
approach?

Allen
Reply all
Reply to author
Forward
0 new messages