> construct the JPanel outside the atom, add all the listeners and then > add the panel to structure in the atom. > > (let [panel (JPanel. ..)] > (add-listener-stuff panel the-atom) > (swap! the-atom assoc :SpiffyPanel panel)) > > Side-effecting things shouldn't be done inside the swap! since it can > be retried multiple times. So you would set up a panel, find that you > have to retry, start over, retry, start over, retry, ....
Okay, I'll add the panel outside. But I don't think this is really a side effect. The events that call swap won't be called inside the function that is creating the panel since they're event listeners. Thanks. -- 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 To unsubscribe from this group, send email to clojure+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.