So I have

(ns foo.bar.baz)

and I want to grab clojure.contrib.core/seqable?

What do I do?

(ns foo.bar.baz
  (use clojure.contrib.core :only seqable?))

#<CompilerException java.lang.IllegalArgumentException: Don't know how to
create ISeq from: Boolean (NO_SOURCE_FILE:0)>

(ns foo.bar.baz
  (use [clojure.contrib.core :only seqable?]))

#<CompilerException java.lang.IllegalArgumentException: Don't know how to
create ISeq from: Boolean (NO_SOURCE_FILE:0)>

(ns foo.bar.baz
  (:use [clojure.contrib.core :only seqable?]))

#<CompilerException java.lang.IllegalArgumentException: Don't know how to
create ISeq from: Symbol (NO_SOURCE_FILE:0)>

etc.

Anyone else noticing a pattern here? a) a need to play a variation of the
old command-line-prompt guess-the-synonym game to get it to work, because
the documentation for "ns" doesn't give actual examples nor does that for
"use" and b) completely uninformative error messages that don't even
identify the ns form as the problem, though it is.

Really, to refer to the exact syntax for a use clause in an ns form I
shouldn't have to do more than a) go to clojure.org/api, b) go to the entry
on "ns", and c) skim. But it takes careful reading and pointer-following
(from "ns" to "use" and then "require", then backtrack, then "refer")
instead of a quick and easy skim, largely owing to the lack of actual
examples of usage in the docs. Which are unnecessary in most places, but the
"ns" macro is an exception since it has its own mini-DSL inside it. (The
for/doseq/doall triad is the other major culprit in that regard.)

In case anyone was wondering, apparently it wants

(ns foo.bar.baz
  (:use [clojure.contrib.core :only (seqable?)]))

(and thus violates the usual clojure rule of using vectors rather than lists
for groupings that are not invocations -- that is, function calls, macro
calls, or special form calls).

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