For example, with Spinoza: (def my-circle (make-instance circle)) (instance-of? my-circle circle) ; > true
circle is just a struct. On Sat, Feb 21, 2009 at 2:09 PM, David Nolen <dnolen.li...@gmail.com> wrote: > This not hard to implement. This exactly what Spinoza does. Feel free to > lift any of my code. > > > On Sat, Feb 21, 2009 at 9:08 AM, Mark Volkmann > <r.mark.volkm...@gmail.com>wrote: > >> >> Is there a way to test whether a given object is an instance of a >> given structmap? >> For example, >> >> (defstruct dog-struct :name :breed) >> >> (def my-dog (struct dog-struct "Dasher" "whippet")) >> >> (when (some-function my-dog dog-struct) >> (println "It's a dog!")) >> >> -- >> R. Mark Volkmann >> Object Computing, Inc. >> >> >> >> > --~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---