On Aug 29, 2011, at 2:57 PM, Tassilo Horn wrote: > > I guess the problem with that is that you need to have an instance of > the record before you can use `keys'. And to create an instance, at > least you have to know the number of keys. > > However, you can inspect the record's constructor using reflection:
Or, if structs will do for your application, then you can do this more simply: user=> (defstruct mystruct :a :b :c) #'user/mystruct user=> (keys (struct-map mystruct)) (:a :b :c) -Lee -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en