Then I try to compile Java code to use it:
import java.lang.reflect.Method;
import t.core;
import t.core.TRecord;
Attempting to compile this with the jar in the classpath produces a
"cannot find symbol" error for the TRecord class. It does however
compile with the last import line commented out, and when run this
successfully prints out the name of the class and its methods.
Well, t.core exists because in his ns declaration he included
:gen-class. Now, this isn't necessary for compiling records. As for
why it isn't compiling, I am not sure. I tried replicating the problem
(albiet without Leiningen), but was unable to.
Here is the code I used:
t/core.clj:
(ns t.core)
(defrecord TRecord [a b c])
(compile 't.core)
---
Main.java:
import t.core.TRecord;
public class Main {
public static void main(String[] args) {
System.out.println(new TRecord(1,2,3));
}
}
----
Sincerely,
Daniel Solano Gómez
Well, t.core exists because in his ns declaration he includedOn Thu Mar 3 13:48 2011, Aaron Cohen wrote:
> On Wed, Mar 2, 2011 at 11:38 PM, Earl J. Wagner <dont.sp...@gmail.com>wrote:
:gen-class. Now, this isn't necessary for compiling records. As for
why it isn't compiling, I am not sure. I tried replicating the problem
(albiet without Leiningen), but was unable to.