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