This file contains hidden or 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
;; An example of the "accounts" program for Venkat Subramaniam's | |
;; Programming Concurrency Workshop, part 1 | |
;; | |
;; Original Java code by Venkat Subramaniam (@venkat_s) | |
;; available at http://www.agiledeveloper.com/downloads.html | |
;; under "Workshop: Programming Concurrency" | |
;; | |
;; This code example by Stuart Sierra (@stuartsierra) | |
;; | |
;; Überconf 2011, Denver, Colorado |
This file contains hidden or 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
(ns resource | |
"Automatic resource cleanup." | |
(:import (java.lang.ref ReferenceQueue PhantomReference))) | |
(def ^:private queue (ReferenceQueue.)) | |
(def ^:private cleanup-fns {}) | |
(defn resource | |
"Returns a reference to x. At some point after the reference is |
This file contains hidden or 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
<profiles> | |
<profile> | |
<id>default</id> | |
<activation> | |
<activeByDefault>true</activeByDefault> | |
</activation> | |
<dependencies> | |
<dependency> | |
<groupId>org.clojure</groupId> | |
<artifactId>clojure</artifactId> |
This file contains hidden or 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
[INFO] [clojure:testCompile {execution: test-compile-clojure}] | |
[DEBUG] Searching /Users/stuart/src/clojure/clojure/src/test/clojure/clojure for clojure namespaces | |
[DEBUG] Searching /Users/stuart/src/clojure/clojure/src/test/clojure/clojure/test_clojure for clojure namespaces | |
[DEBUG] Searching /Users/stuart/src/clojure/clojure/src/test/clojure/clojure/test_clojure/agents.clj for clojure namespaces | |
[DEBUG] Found namespace clojure.test-clojure.agents in file /Users/stuart/src/clojure/clojure/src/test/clojure/clojure/test_clojure/agents.clj | |
.... | |
[DEBUG] Java exectuable used: java | |
[DEBUG] Clojure classpath: /Users/stuart/src/clojure/clojure/src/test/java:/Users/stuart/src/clojure/clojure/src/test/clojure:/Users/stuart/src/clojure/clojure/target/test-classes::/Users/stuart/src/clojure/clojure/target/test-classes:/Users/stuart/src/clojure/clojure/target/classes |
This file contains hidden or 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
#!/bin/sh | |
# reload-aot-error.sh | |
# This file demonstrates the problems that result from | |
# unloading-and-reloading Clojure namespaces whose source files are | |
# newer than their AOT-compiled .class files. | |
# To run the demonstration, copy this script and clojure.jar into an | |
# empty directory, then execute the script. |
This file contains hidden or 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
Clojure 1.2.0-master-SNAPSHOT | |
user=> (use 'com.stuartsierra.lazytest) | |
Warning: protocol #'com.stuartsierra.lazytest/TestInvokable is overwriting function invoke-test | |
Warning: protocol #'com.stuartsierra.lazytest/TestResult is overwriting function success? | |
nil |
NewerOlder