Contribution:
clojureRefs
Headline
A Clojure-based implementation that uses transactional references
Motivation
Clojure provides a number of interesting approaches to the development with concurrency. One of these approaches is the use of programmable transactions, analogous to database transactions. This functionality is implemented by means of transaction-specific functions and references. To maintain a consistent memory state, Clojure relies on a STM. This project is based on the implementation Contribution:clojure and changes it so that Refs and transactions are used.
Illustration
Changes to Refs by a transformation like Feature:Cut have to be encapsulated into a transaction. In Clojure the function dosync starts such a transaction allowing to alter Refs by an update function.
(defn cutCompany [c]
(dosync
;; alter ref function
(alter c #(update-in % [:depts] (partial map cutDept))))
;; returning changed ref
c)
Architecture
- company.clj definitions of the companies structure using clojure's defrecord
- scenarios.clj functionalities: Feature:Cut, Feature:Total
- meganalysis.clj a sample company (i.e. a Ref to a Feature:Hierarchical company)
Usage
You need to install the Eclipse plugin CounterClockwise. Update Site: http://ccw.cgrand.net/updatesite
Then open meganalysis.clj, hit "run" and excute the function you like:
- (totalCompany meganalysis)
- (cutCompany meganalysis)
User contributions
User edits
Syntax for editing wiki
For you are available next options:will make text bold.
will make text italic.
will make text underlined.
will make text striked.
will allow you to paste code headline into the page.
will allow you to link into the page.
will allow you to paste code with syntax highlight into the page. You will need to define used programming language.
will allow you to paste image into the page.
is list with bullets.
is list with numbers.
will allow your to insert slideshare presentation into the page. You need to copy link to presentation and insert it as parameter in this tag.
will allow your to insert youtube video into the page. You need to copy link to youtube page with video and insert it as parameter in this tag.
will allow your to insert code snippets from @worker.
Syntax for editing wiki
For you are available next options:will make text bold.
will make text italic.
will make text underlined.
will make text striked.
will allow you to paste code headline into the page.
will allow you to link into the page.
will allow you to paste code with syntax highlight into the page. You will need to define used programming language.
will allow you to paste image into the page.
is list with bullets.
is list with numbers.
will allow your to insert slideshare presentation into the page. You need to copy link to presentation and insert it as parameter in this tag.
will allow your to insert youtube video into the page. You need to copy link to youtube page with video and insert it as parameter in this tag.
will allow your to insert code snippets from @worker.