sounds fun, have you seen this yet? http://cemerick.com/2011/07/05/flowchart-for-choosing-the-right-clojure-type-definition-form/
On Fri, Jun 7, 2013 at 3:21 PM, Denis Labaye <denis.lab...@gmail.com> wrote: > 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 > setters f.setBar("ze bar")And then call some methods f.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. > > > -- -- 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.