for simple cases, I tend to see that this operation is used directly, and not wrapped in a function:
hello.core> (dosync (some-work @the-ref) (ref-set the-ref 5))
5
In this case, it is usually used as the wrapper you are looking for. within This is important because dosync blends well with other transactions and makes transaction boundaries visible. If you are in a position where the wrapper function can fully encapsulate all ref references, refs might not be the best tool. dosyncdosync
A typical use of links may look in the following ways:
(dosync (some-work @the-ref @the-other-ref) (ref-set the-ref @the-other-ref))
, , ref, ref, . , , .