The ugly way, as you noted, is to change the atom from some-map to
[some-map extracted-info-from-last-swap].
A less ugly way might be
(let [ei (atom nil)]
(swap! my-atom
...
(reset! ei extracted-info1)
...)
(do-things-with ei))
If the swap! is retried, the ei atom will be reset! more than once,
but it will after the swap! contain the extracted-info1 from the
successful swap! of my-atom.
The most functional way would be to see if you couldn't do the work
with ei *inside* the closure. However, if it's expensive or
side-effecty that doesn't play nice with swap! retrying. In that
instance, you might want to think of replacing my-atom with my-ref and
doing something like
(dosync
(alter my-ref
...
(send-off ei-agent ei-do-things-func extracted-info1)
...))
Agent sends are held until a transaction commits, so the
ei-do-things-func will be called only once for each transaction on
my-ref.