You are missing a close-paren in

(let [lines  (line-seq (java.io.BufferedReader. *in*)]

The compiler would certainly complain about this from swank, so I get
the feeling you haven't pasted your actual code. Did you make some
edits?

Also, those free-standing ) and ] characters make me dizzy. My feeling
is that, when *some* parens are on new lines and some are bundled
together, it indicates that the programmer is still thinking in terms
of blocks and statements, rather than expressions: "let introduces a
new block so its close paren needs a new line, but colorize is just an
expression so I'll pile it up with the others". Of course you can
format your code however you want, but *everything* is an expression,
and it's usual to just pile up N close-braces when N expressions end.

On May 18, 7:44 am, Arnoldo Muller <[email protected]> wrote:
> Hello,
>
> I am trying to compile a project with lein. The program source files
> can be interpreted successfully (using swank-clojure) but when I try
> to do "lein compile" or "lein jar" I get:
>
> Exception in thread "main" java.lang.ClassCastException:
> clojure.lang.PersistentVector cannot be cast to clojure.lang.Named
> (NO_SOURCE_FILE:1)
>         at clojure.lang.Compiler.eval(Compiler.java:5440)
>         at clojure.lang.Compiler.eval(Compiler.java:5415)
>         at clojure.lang.Compiler.eval(Compiler.java:5391)
>         at clojure.core$eval.invoke(core.clj:2382)
>         at clojure.main$eval_opt.invoke(main.clj:235)
>         at clojure.main$initialize.invoke(main.clj:254)
>         at clojure.main$null_opt.invoke(main.clj:279)
>         at clojure.main$main.doInvoke(main.clj:354)
>         at clojure.lang.RestFn.invoke(RestFn.java:422)
>         at clojure.lang.Var.invoke(Var.java:369)
>         at clojure.lang.AFn.applyToHelper(AFn.java:165)
>         at clojure.lang.Var.applyTo(Var.java:482)
>         at clojure.main.main(main.java:37)
> Caused by: java.lang.ClassCastException: clojure.lang.PersistentVector
> cannot be cast to clojure.lang.Named
>         at clojure.core$name.invoke(core.clj:1245)
>         at clojure.core$root_resource.invoke(core.clj:4712)
>         at clojure.core$load_one.invoke(core.clj:4729)
>         at clojure.core$compile$fn__4516.invoke(core.clj:4916)
>         at clojure.core$compile.invoke(core.clj:4915)
>         at user$eval7.invoke(NO_SOURCE_FILE:1)
>         at clojure.lang.Compiler.eval(Compiler.java:5424)
>         ... 12 more
> Compilation failed.
>
> The source code looks like:
>
> (ns graphcluster.colorize-map
>   (:gen-class)
>   (:use clojure.contrib.command-line)
>         (:require graphcluster.core)
>         (:require clojure.contrib.str-utils)
>         )
> ;  function definitions, they all run in swank-clojure
> (defn -main [& args]
>         (let [lines  (line-seq (java.io.BufferedReader. *in*)
>                ]
>                 (print (colorize (clojure.contrib.str-utils/str-join "\n" 
> lines)))
>   ))
>
> In graphcluster.core there are some defs. I have for instance a sketch
> object from incanter.processing .
>
> I am using leiningen 1.5.2 and Clojure 1.2. Do you have any ideas
> about the nature of this error?
>
> Thanks!
>
> Arnoldo

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to