Michael Reid <[email protected]> writes:
Hi Michael,
>> ...
>> Graph g = GraphIO.loadGraphFromFile("foo.tg");
>> defInClojure("graph", g);
>> ...
>>
>> so that from inside SLIME I have a variable graph holding a reference
>> to the graph g from the java app. If possible, how would I do this?
>>
>
> You can create a Clojure var from Java with:
>
> clojure.lang.RT.var("my-app.graphs", "my-graph", g);
>
> From Clojure, you would refer to this with;
>
> my-app.graphs/my-graph
That's what I'm doing now, and it works like a charm.
>> Another approach would be to find the object of interest from inside
>> SLIME. Something like (find-objects-of-class foo.bar.Graph)
>> returning a seq of all graphs. Is something like that available?
>
> I have no idea if SLIME has any such call. Nor can I really think of
> how I might accomplish that, even directly from Java.
Hm, I had a quick look at the Java docs, and it seems not to be
possible. Since it would outwit encapsulation, such a feature is surely
missing for a reason. ;-)
Bye,
Tassilo
--
sudo = stallman user designation option
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---