clojure - ClojureCLR coercion error -


i'm getting compiler exception in clojureclr repl basic coercion:

=> (class 12) system.int64  => (class 12.34) system.double  => (class (new system.double 12)) compilerexception system.invalidoperationexception: no constructor in type: double 1 arguments @ clojure.lang.cljcompiler.ast.newexpr.computector() in d:\work\clojure-clr-1.4.1-fix\clojure\clojure\cljcompiler\ast\newexpr.cs:line 73 @ clojure.lang.cljcompiler.ast.newexpr..ctor(type type, list`1 args, ipersistentmap spanmap) in d:\work\clojure-clr-1.4.1-fix\clojure\clojure\cljcompiler\ast\newexpr.cs:line 49 @ clojure.lang.cljcompiler.ast.newexpr.parser.parse(parsercontext pcon, object frm) in d:\work\clojure-clr-1.4.1-fix\clojure\clojure\cljcompiler\ast\newexpr.cs:line 117 @ clojure.lang.compiler.analyzeseq(parsercontext pcon, iseq form, string name) in d:\work\clojure-clr-1.4.1-fix\clojure\clojure\cljcompiler\compiler.cs:line 1560, compiling: (no_source_path:60) 

sorry if newbish question, isn't behaving same java interop!

is syntax different .net?

interop in clojureclr similar interop in clojure, platform differences show through.

java.lang.double different creature system.double. jvm's double wrapper class distinct class of primitive double values. clr's double class of primitive double values. j.l.double has many methods not paralleled in s.double. re example: j.l.double has several constructors; s.double has none. accomplish want, use clojure.core/double:

user=> (class (double 2)) system.double 

the java wrapper types place run platform differences: clr not have explicit wrapper types. don't know of place has tried cover in detail.

for hints on how handle clr interop things not in jvm, such by-ref parameters, enums, etc., check out the wiki on github repo clojureclr.


Comments