Ref Type: Ref
is a reference type which is shared, asynchronous, and coordinated:
- shared - multiple threads can share access
- asynchronous - changes may not occur immediately
- coordinated - changes can be made to multiple items
Example: Move $20 from this account to that account, right now.
Refs allow coordinated modification of multiple storage locations,
by means of a software transactional memory (STM) system.
"CC" links to the official Clojure documentation; "CD" links to ClojureDocs.
- alter (CC, CD) - sets the in-transaction-value of a Ref
- commute (CC, CD) - sets the in-transaction-value of a Ref
- ensure (CC, CD) - protects the Ref from other transactions
- ref (CC, CD) - creates and returns a Ref
- ref-set (CC, CD) - sets the value of a Ref
To be continued...
This wiki page is maintained by Rich Morin
an independent consultant specializing in software design, development, and documentation.
Please feel free to email
comments, inquiries, suggestions, etc!