Works fine for me, with your code pasted exactly as written. You'll
probably get better help if you give a real stack trace, though.

Also, you might take a look at clojure.string/join: it does just what
your strcat function does, as well as most of what reverseWords does.

On Feb 3, 9:00 pm, Robert McIntyre <r...@mit.edu> wrote:
> I was recently using gen-class and ran into this problem:
>
> (def strcat (partial apply str))
>
> (defn rev-reverse [s] (strcat (reverse s)))
>
> (defn rev-reverseWords [s]
>   (strcat (interpose " " (reverse (.split s " ")))))
>
> (defn rev-isWordPalindrome [s]
>   (if (nil? s) true
>       (= s (rev-reverseWords s))))
>
> (gen-class
>  :name functional.Scrambler
>  :methods
>  [#^{:static true} [reverse [String] String]
>   #^{:static true} [reverseWords [String] String]
>   #^{:static true} [isWordPalindrome [String] Boolean]]
>   :prefix "rev-")
>
> when I call Scrambler.isWordPalindrome(null) I get a null pointer error.....
> How can I make a null safe function with gen-class?
>
> sincerely,
> --Robert McIntyre

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

Reply via email to