That's fair, except that it's a little disappointing that I can't
reference nested structures from Clojure in the natural way, akin to
Java. In Java, if I had imported NestedStatics, I could reference
NestedStatics.LevelOne without bringing LevelOne into my namespace
(and possibly into conflict wi
On Mon, Dec 28, 2009 at 02:50:59PM -0800, Mark Tomko wrote:
>This, however, does not work:
>
>(ns org.tomko.konkordans.analysis
> (:import
>(org.tomko.konkordans NestedStatics)))
>
>(def foo NestedStatics$LevelOne$LevelTwo/NO)
The class is called NestedStatics$LevelOne$LevelTwo, so you would
This, however, does not work:
(ns org.tomko.konkordans.analysis
(:import
(org.tomko.konkordans NestedStatics)))
(def foo NestedStatics$LevelOne$LevelTwo/NO)
user=> (load-file "/Users/mark/IdeaProjects/Konkordans/src/org/tomko/
konkordans/analysis.clj")
java.lang.Exception: No such namespac
This appears to work:
user=> (str org.tomko.konkordans.NestedStatics$LevelOne)
"class org.tomko.konkordans.NestedStatics$LevelOne"
Is this depending on a detail of implementation? It feels funny to
me, but perhaps it's the best way to do it.
On Dec 28, 5:42 pm, David Brown wrote:
> On Mon, Dec
On Mon, Dec 28, 2009 at 02:32:48PM -0800, Mark Tomko wrote:
>user=> (str.org.tomko.konkordans.NestedStatics/LevelOne)
Does
str.org.tomko.konkordans.NestedStatics$LevelOne/ONE
Work?
You can always look in the class output directory that the Java
compiler generates, and see the resulting cla
Is there a way to reference nested static members of Java classes
using Clojure? I tried a few things and couldn't get it to work. To
simplify the question a bit, I wrote the following Java class:
package org.tomko.konkordans;
public class NestedStatics {
public static String FOO = "foo";