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