> One answer to my question would be to force Clojure to throw an exception if
> querying a non-existant property on the data-structure...is that possible?
>  For example, in the following snippet, (t {:c 10}) would fail.  I assume a
> macro-or-something?
>
> Clojure> (defn t [a] (print (str (:b a))))
> #'sandbox5950/t
> Clojure> (t {:b 10})
> 10nil
> Clojure> (t {:c 10})
> nil
> Clojure>

You should take a look at Clojure's pre-conditions for a possible
solution. Here is a blog post that explains their usage -
http://blog.fogus.me/2009/12/21/clojures-pre-and-post/

Regards,
BG

-- 
Baishampayan Ghose
b.ghose at gmail.com

-- 
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