Re: (string?) bug

2008-11-12 Thread Stuart Sierra
On Nov 11, 4:27 pm, Dave Newton [EMAIL PROTECTED] wrote: I'd say create your own (stringish? ...) function then--since Clojure is strongly Java-interop returning a T for a non-String would make (string? ...) seem less useful, but that's just my opinion. And every Java object has a

Re: (string?) bug

2008-11-11 Thread Dave Newton
--- On Sun, 11/9/08, Brian Doyle wrote: Yes, it is a StringBuilder so technically yes. I guess you since the only thing you ever do with a StringBuilder is produce a string it just seemed like it would be a string. Same goes for StringBuffer. I'd say create your own (stringish? ...)

Re: (string?) bug

2008-11-11 Thread Brian Doyle
Yep, I'm going that route. Thanks On Tue, Nov 11, 2008 at 2:27 PM, Dave Newton [EMAIL PROTECTED] wrote: --- On Sun, 11/9/08, Brian Doyle wrote: Yes, it is a StringBuilder so technically yes. I guess you since the only thing you ever do with a StringBuilder is produce a string it just

Re: (string?) bug

2008-11-09 Thread Dave Newton
--- On Sun, 11/9/08, Brian Doyle wrote: This seems like a bug returning false for StringBuilder. user= (string? (new java.lang.String hello)) true user= (string? (new java.lang.StringBuilder hello)) false Wouldn't it be a StringBuilder, and not a String? user= (. (new

Re: (string?) bug

2008-11-09 Thread Stoyan Vassilev
Type predicates do an exact match on the type, StringBuilder is a different class altogether. Why should it return true on a StringBuilder? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to

Re: (string?) bug

2008-11-09 Thread Brian Doyle
Yes, it is a StringBuilder so technically yes. I guess you since the only thing you ever do with a StringBuilder is produce a string it just seemed like it would be a string. Same goes for StringBuffer. On Sat, Nov 8, 2008 at 11:52 PM, Dave [EMAIL PROTECTED] wrote: (Sorry if this is a

Re: (string?) bug

2008-11-08 Thread Luc Prefontaine
A StringBuilder is not a Java String... neither is it a StringBuffer :))) user= (string? (.toString (java.lang.StringBuilder. hello))) true user= because: user= (.getClass (java.lang.StringBuilder. hello)) java.lang.StringBuilder and user= (.getClass (.toString (java.lang.StringBuilder.