Hi,

I'm writting Clojure code that is used by a Java framework (Fitnesse's slim
for those who knows).

To workflow is like this:
Instanciation of a new Java objectf = new Foo()Initialization with
settersf.setBar("ze
bar")And then call some methodsf.baz()

My solution is something like:

(ns Foo
  (:gen-class
   :methods [[setBar [String] void   ]
             [baz    [      ] String ]]))

(def results (atom {}))

(defn -setBar [this s] (swap! results assoc this (do-some-stuff))
(defn -baz    [this  ] (@results this))

It works but is ugly. (Memory is not a problem so no need to release the
objects/results map entries in the atom).

Is this okay ? Can we do better ?

Thx

Denis

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to