Hello,

is there a way to check if a data structure complies to a given
schema? (e.g. people is a vector of persons).

I'm using C# a lot and maybe the static typing has changed the way I
think. I feel like adding "type checks" in unit tests and being able
to say something like:

(is-type (people (vector person)))

sounds like a neat way to check types (I know 'vector' is a 'taken'
name, I'm just trying to illustrate the kind of syntax I'm thinking
about). The degree of typing can be varied (i.e. a person is any map
with a :name key, or any map with only a :name key, or any map with a
:name key which is nil or string etc.)

I browsed through clojure.test (which is clojure.contrib.test-is
integrated into Clojure, right?) but couldn't find something like
this.

Thank you,
-- 
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to