First thanks for the vsClojure extension. I have been waiting for this
for a long time.
I am new to clojure and obviously to vsClojure. I tried the pig-latin
example in the Clojure Article (
http://java.ociweb.com/mark/clojure/
article.html) where I put it in a new project like this:
(ns program)
(def vowel? (set "aeiou"))
(defn pig-laten [word]
(let [first-letter (first word)]
(if (vowel? first-letter)
(str word "ay")
(str (subs word 1) first-letter "ay"))))
(defn main [& args] (
(pig-laten "red")
(pig-laten "orange")))
(main)
but I get this error when I compile:
System.InvalidCastException was unhandled
Message=Unable to cast object of type 'System.String' to type
'clojure.lang.IFn'.
Source=Anonymously Hosted DynamicMethods Assembly
StackTrace:
at main(Closure , Object )
at clojure.lang.RestFnImpl.doInvoke(Object args)
at clojure.lang.RestFn.invoke()
at clojure.lang.RestFnImpl.invoke()
at lambda_method(Closure )
at AFunction_impl.invoke()
at REPLCall(Closure )
at clojure.lang.Compiler.eval(Object form)
at clojure.lang.Compiler.load(TextReader rdr, String
sourcePath, String sourceName, String relativePath)
at clojure.lang.Compiler.loadFile(String filename)
at clojure/main
$fn__16728$load_script__16730.__invokeHelper_1(clojure/main
$fn__16728$load_script__16730_base this, Object path) in main.clj:line
220
at clojure/main$fn__16728$load_script__16730.invoke(Object )
at clojure/main
$fn__16735$init_opt__16737.__invokeHelper_1(clojure/main
$fn__16735$init_opt__16737_base this, Object path) in main.clj:line
225
at clojure/main$fn__16735$init_opt__16737.invoke(Object )
at clojure/main
$fn__16756$initialize__16758.__invokeHelper_2(clojure/main
$fn__16756$initialize__16758_base this, Object args, Object inits) in
main.clj:line 253
at clojure/main$fn__16756$initialize__16758.invoke(Object ,
Object )
at clojure/main
$fn__16796$null_opt__16798.__invokeHelper_2(clojure/main
$fn__16796$null_opt__16798_base this, Object args, Object inits) in
main.clj:line 278
at clojure/main$fn__16796$null_opt__16798.invoke(Object ,
Object )
at clojure/main$fn__16835$main__16837.__invokeHelper_0v(clojure/
main$fn__16835$main__16837_base this, Object args) in main.clj:line
353
at clojure/main$fn__16835$main__16837.doInvoke(Object )
at clojure.lang.RestFn.invoke(Object arg1, Object arg2)
at clojure.lang.Var.invoke(Object arg1, Object arg2)
at clojure.lang.AFn.ApplyToHelper(IFn ifn, ISeq arglist)
at clojure.lang.Var.applyTo(ISeq arglist)
at Clojure.CljMain.Main(String[] args)
InnerException:
Is this an error in the clojureclr or in vsClojure. Any help is
appreciated.