Hi,
the following session will probably explain the problem:
user=> (digit? \5)
true
user=> (ancestors java.lang.Integer)
#{java.io.Serializable java.lang.Comparable java.lang.Number java.lang.Object}
user=> (ancestors java.lang.Character)
#{java.io.Serializable java.lang.Comparable java.lang.Object}
The literal 5 is probably cast into an int/Integer, not a
char/Character. If you want to write char/Character literals, place an
antislash at the front of the literal.
Regards,
--
Laurent
2009/5/20 Arie van Wingerden <[email protected]>:
> Hi,
>
> when I evaluate:
>
> (defn digit? [d]
> (. Character isDigit d))
> (digit? 5)
>
> I get false as a result.
>
> It appears that the 5 does not match the correct type Java expects, or what?
>
> TIA,
> Arie
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---