Op donderdag 17 april 2014 09:34:52 UTC+2 schreef Tassilo Horn:
>
> Stanislas Nanchen <stanisla...@gmail.com <javascript:>> writes: 
>
> > You miss one parentheses at the end of your expression 
> > 
> > (defn boolean [x] 
> >   (if (and (nil? x) (false? x)) 
> >   )) 
>
> And now you have an if without then which will give you another 
> exception.  And the test expression is a contradiction, i.e., it's 
> always false.  Nothing can be both nil? and false?. 
>

You are right. Stupid thinking error of me. 
 

>
> > I have to check if x is a nil or false and then the output must be 
> > false,\ Otherwise I have to be true. 
>
> Why?  nil and false are already falsy, everything else is true.  And if 
> you have to interact with java where some method wants some "real" 
> boolean, then there's already clojure.core/boolean. 
>
>
In this exercise you are not allowed to use boolean.

Roelof
 

> Bye, 
> Tassilo 
>

-- 
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
--- 
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to