Ah, right, this is the function called from swap!. So move the listener stuff out of your swap function and into the function that calls swap! instead?
On Thu, Mar 25, 2010 at 11:02 PM, Josh Stratton <strattonbra...@gmail.com> wrote: >> I would just pass the atom and move the @ inside the function... > > But the non-atom is automatically dereferenced and sent to the > respective function when I use swap! So unless there's another > function to alter atoms, I'm going to have the dereferenced version > there no matter what, right? > >> >> On Thursday, March 25, 2010, strattonbrazil <strattonbra...@gmail.com> wrote: >>> I have a function that I use for adding a JPanel to a ui atom. When I >>> call swap! that ui atom is sent to that function I call with the swap! >>> on and is dereferenced inside the function so I don't need to call @ui >>> on it. However, I want to add listeners to my JPanel that can affect >>> that atom, but I don't have the actual atom anymore since it's >>> deferenced when I pass it to swap. I believe I could just pass it as >>> another parameter, but that seems like a hack. >>> >>> (defn swap-function [ui atomWithUiInIt] >>> >>> ; add code that on a click or press or something, alter the >>> atomWithUiInIt atom >>> ...) >>> >>> Is there better way to handle this? >>> >>> -- >>> 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. >>> >> >> -- >> Mark J. Reed <markjr...@gmail.com> >> >> -- >> 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. >> > > -- > 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. > -- Mark J. Reed <markjr...@gmail.com> -- 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.