-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from pmonks/issue-23
Address issue #23, and also switch to Markdown format for the docs
- Loading branch information
Showing
9 changed files
with
232 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
;;; This namespace contains 3rd party code obtained from other sources. | ||
;;; Copyright and license information is listed on a per-var basis. | ||
|
||
(ns progress.3rd-party) | ||
|
||
;; Copyright 2014 A. Webb (https://stackoverflow.com/users/1756702/a-webb) | ||
;; SPDX-License-Identifier: CC-BY-SA-3.0 | ||
(defn swap*! | ||
"Like [[clojure.core/swap!]] but returns a vector of `[old-value new-value]`. | ||
Adapted from [this StackOverflow question](https://stackoverflow.com/a/22409846)." | ||
[atom f & args] | ||
(loop [] | ||
(let [ov @atom | ||
nv (apply f ov args)] | ||
(if (compare-and-set! atom ov nv) | ||
[ov nv] | ||
(recur))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.