Hi, thanks for the suggestions about writing an alternate defstruct. I tried to turn the wishful thinking from my initial email into code. Results here:
http://github.com/mbrezu/beak-check Testing structures with beak-check requires some code, but it allows to test nested structures and testing the type of the structure members. I welcome any thoughts/ideas/critiques. Thanks again, On Thu, Sep 24, 2009 at 7:39 PM, Richard Newman <holyg...@gmail.com> wrote: > >> Use it just like you use defstruct, e.g.: (defstruct* person :first- >> name :last-name :age), but it will also create a little type-checker >> function: is-person? Here are some tests to see how it works: > > Note that your type checker will give false positives if you're > intending to use accessors: an ordinary map with the same keys will > match the predicate, but accessor calls will fail. > > (I also have a defstruct*, but it defines accessors and a struct-map > coercion, not a predicate :)) > -- Miron Brezuleanu --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---