More weirdness. This works:
(let [^Object aa (.seq a5)]
(println (.getClass aa)))
But not this:
(let [^AASetSequence aa (.seq a5)]
(println (.getClass aa))))
Nor, of course, this:
(let [^AASetSequence aa (.seq a5)]
(println (.count aa)))
Here's the error I'm getting now:
Information:8/22/2015 5:45 PM - Compilation completed with 1 error and 0
warnings in 2s 743ms
C:\Users\Bill\Documents\GitHub\aa-collections\test\aa_collections\immutable_set_test.clj
Error:(26, 12) clojure: java.lang.NoClassDefFoundError:
java/util/function/UnaryOperator,
compiling:(aa_collections/immutable_set_test.clj:26:12)
java.lang.ClassNotFoundException: java.util.function.UnaryOperator
at java.net.URLClassLoader$1.run (URLClassLoader.java:366)
java.net.URLClassLoader$1.run (URLClassLoader.java:355)
java.security.AccessController.doPrivileged (AccessController.java:-2)
java.net.URLClassLoader.findClass (URLClassLoader.java:354)
java.lang.ClassLoader.loadClass (ClassLoader.java:425)
java.lang.ClassLoader.loadClass (ClassLoader.java:358)
java.lang.Class.getDeclaredMethods0 (Class.java:-2)
java.lang.Class.privateGetDeclaredMethods (Class.java:2570)
java.lang.Class.privateGetPublicMethods (Class.java:2690)
java.lang.Class.getMethods (Class.java:1467)
On Saturday, August 22, 2015 at 5:37:13 PM UTC-4, William la Forge wrote:
>
> Hi Colin!
>
> I've set it up to compile all. No doubt this will be very helpful as I
> will no longer need to compile using an external `lein compile`. But run
> still dies on the call (.getClass x), when x is a gen-class compiled class
> instance.
>
> On the other hand I still can not credit this as a Cursive bug. Calling
> methods on gen-class compiled class instances is to basic. But it is likely
> related to Cursive, as 'lein test' works great.
>
> On Saturday, August 22, 2015 at 4:24:40 PM UTC-4, Colin Fleming wrote:
>>
>> Hi William,
>>
>> Right, you'll need to tell Cursive to compile that namespace in
>> *Settings->Build,
>> Execution, Deployment->Compiler->Clojure Compiler*. Once you've done
>> that things should work. Cursive doesn't currently pick the set of
>> namespaces to be compiled up from lein - it probably should.
>>
>> Cheers,
>> Colin
>>
>> On 22 August 2015 at 17:17, William la Forge <[email protected]> wrote:
>>
>>> I searched and did not see anything recent on gen-class problems in
>>> Cursive. I find when I have a reference to a gen-class instance that
>>> instance? works in Cursive but .getClass does not. (Everything works with
>>> lein, of course.)
>>>
>>> What I am trying to do is to call the count method via (.count x). What
>>> I do not want to do is call the clojure count function, (count x). Again,
>>> no issues with lein.
>>>
>>> I suspect I simply have not completed the setup cursive for compiles or
>>> something, as all the complaints about cursive/gen-class that I could find
>>> were a year old.
>>>
>>> I know I need to switch to emacs at some times. I mean, it's only been
>>> 30 years since I used it last. :D
>>>
>>> Here's the error I'm getting:
>>>
>>> Exception in thread "main" java.lang.NoClassDefFoundError:
>>> java/util/function/UnaryOperator,
>>> compiling:(C:\Users\Bill\Documents\GitHub\aa-collections\test\aa_collections\immutable_set_test.clj:22:10)
>>> at clojure.lang.Compiler.analyzeSeq(Compiler.java:6730)
>>> at clojure.lang.Compiler.analyze(Compiler.java:6524)
>>> at clojure.lang.Compiler.analyzeSeq(Compiler.java:6711)
>>> at clojure.lang.Compiler.analyze(Compiler.java:6524)
>>> at clojure.lang.Compiler.analyze(Compiler.java:6485)
>>> at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3791)
>>> at clojure.lang.Compiler.analyzeSeq(Compiler.java:6725)
>>> at clojure.lang.Compiler.analyze(Compiler.java:6524)
>>> at clojure.lang.Compiler.analyze(Compiler.java:6485)
>>> at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:5861)
>>> at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6179)
>>> at clojure.lang.Compiler.analyzeSeq(Compiler.java:6723)
>>> at clojure.lang.Compiler.analyze(Compiler.java:6524)
>>> at clojure.lang.Compiler.analyze(Compiler.java:6485)
>>> at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:5861)
>>> at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5296)
>>> at clojure.lang.Compiler$FnExpr.parse(Compiler.java:3925)
>>> at clojure.lang.Compiler.analyzeSeq(Compiler.java:6721)
>>> at clojure.lang.Compiler.analyze(Compiler.java:6524)
>>> at clojure.lang.Compiler.eval(Compiler.java:6779)
>>> at clojure.lang.Compiler.load(Compiler.java:7227)
>>> at clojure.lang.Compiler.loadFile(Compiler.java:7165)
>>> at clojure.main$load_script.invoke(main.clj:275)
>>> at clojure.main$script_opt.invoke(main.clj:337)
>>> at clojure.main$main.doInvoke(main.clj:421)
>>> at clojure.lang.RestFn.invoke(RestFn.java:408)
>>> at clojure.lang.Var.invoke(Var.java:379)
>>> at clojure.lang.AFn.applyToHelper(AFn.java:154)
>>> at clojure.lang.Var.applyTo(Var.java:700)
>>> at clojure.main.main(main.java:37)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>> at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>> at java.lang.reflect.Method.invoke(Method.java:606)
>>> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
>>>
>>> --
>>> 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
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
--
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
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.