Yes, that did the trick.
Thank you.

Am 21.02.2012 02:53, schrieb Sean Corfield:
On Sat, Feb 18, 2012 at 1:29 PM, ClusterCat<cluster...@mail.com>  wrote:
(ns test (:import (java.io File)))

This says import the File class from the package java.io

(ns test (:import (java.io.File)))

Try:

(ns test (:import java.io.File))

  (let [filename (first *command-line-args*)]
    (println filename)
    (let [file (File. filename)])))


I get an
"Reflection warning, X:\workspace\ClojureTest\bin\test.clj:9 - call to
java.io.File ctor can't be resolved."
which I also don't understand.

Clojure relies on type hints to avoid reflection - introspecting Java
class types to figure out calls. If you add ^String in let binding for
filename, it should remove the warning:

(let [^String filename (first *command-line-args*)] ...

HTH?

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