HI Ambrose,
Thanks for your reply. But why this one is working?
(defn check-nil [v]
{:pre [nil? v]}
v)
Br,
Mamun
On Thursday, February 13, 2014 11:51:31 AM UTC+1, Ambrose Bonnaire-Sergeant
wrote:
>
> Hi Mamun,
>
> This is the correct syntax (you're missing some parens).
>
> (defn check-keyword [v] {:pre [(keyword? v)]} v)
>
> Thanks,
> Ambrose
>
>
> On Thu, Feb 13, 2014 at 6:47 PM, Mamun <[email protected] <javascript:>>wrote:
>
>> Hi
>>
>> I am just testing clojure :pre condition. But look like using keyword?,
>> it is not working in clojure 1.5.1.
>>
>> (defn check-keyword [v] {:pre [keyword? v]} v)
>>
>> (defn check-nil [v] {:pre [nil? v]} v)
>>
>> (check-keyword “sdf”) ;Not throwing exception here
>>
>> (check-nil nil) ;Throwing exception
>>
>>
>>
>> Br,
>>
>> Mamun
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to [email protected]<javascript:>
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> To unsubscribe from this group, send email to
>> [email protected] <javascript:>
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.