position/index-of function

2010-03-17 Thread John R. Williams
I'm looking for a function along the lines of java.util.List.indexOf, and I'm having a hard time believing it's not there in the core or at least contrib. I was expecting to find something like this: (defn index-of [coll item] (let [index (.indexOf (sequence coll) item)] (if (neg? index)

difficulty with becoming a contributor

2010-03-10 Thread John R. Williams
I have some patches I'd like to submit, but I'm having trouble with the submission process. I've sent in a CA, and my name is on the contributor list (at http://clojure.org/contributing), but I still can't submit tickets on Assembla, and my membership to clojure-dev is still pending. Do I need to

error reporting for macro expansion

2010-02-08 Thread John R. Williams
The Clojure compiler is not very helpful when it comes to debugging exceptions that occur while macros are being expanded. As an example, consider this code: ;; macro-fail.clj (defmacro broken [] (/ 0 0)) (broken) Here's the stack trace I get when I compile this file: Exception in thread main