Tassilo Horn a écrit : > Tassilo Horn <tass...@member.fsf.org> writes: > > >>> Take a look at this blog post: >>> http://avodonosov.blogspot.com/2008/12/simpler-clojureslime-embedding.html >>> >>> I think you will find it useful. >>> >> Cool, but I had to modify it a bit to get it working: >> >> (add-classpath "file:///home/horn/repos/el/swank-clojure/") >> (require 'swank.swank 'clojure.main) >> (clojure.main/with-bindings >> (swank.swank/ignore-protocol-version "2008-11-23") >> (swank.swank/start-server "nul" :encoding "utf-8-unix" :port 7777)) >> > > Ok, so now I can start a swank server from Java and can connect to it > using SLIME. But now comes the next problem: How do I access the > objects of the running java app? > > Basically all our apps operate on a graph, and that's what I'd like to > have accessible from clojure. So I want something like that: > > ... > Graph g = GraphIO.loadGraphFromFile("foo.tg"); > defInClojure("graph", g); > ... >
You can put your g object in a static field and access this static field from Clojure or define a var: clojure.lang.RT.var("my-namespace", "my-varname", g) Christophe -- Professional: http://cgrand.net/ (fr) On Clojure: http://clj-me.blogspot.com/ (en) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---