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
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 |
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
#!/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 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 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 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 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 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
;; Adapted from "An empirical comparison of C, C++, Java, Perl, | |
;; Python, Rexx, and Tcl for a search/string-processing program" | |
;; by Lutz Prechelt | |
;; This was a 15-minute effort while listening to a talk. It's *not* | |
;; well thought-out or designed. | |
;; By Stuart Sierra, | |
;; @stuartsierra on Twitter |
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
;;; XML parsing and clojure.zip | |
;;; There's got to be a cleaner way to do this. | |
;;; I have code like this: | |
(defn jdks-loc [xml-zipper] | |
(zip/down | |
(first | |
(filter #(let [n (zip/node %)] |
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
;; Add this to ~/.emacs | |
;; Missing from ruby-mode.el, see https://groups.google.com/group/emacs-on-rails/msg/565fba8263233c28 | |
(defun ruby-insert-end () | |
"Insert \"end\" at point and reindent current line." | |
(interactive) | |
(insert "end") | |
(ruby-indent-line t) | |
(end-of-line)) |
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
(ns test-clj-byte-chunk-seq | |
(:import (java.io InputStream OutputStream | |
FileInputStream FileOutputStream))) | |
(set! *warn-on-reflection* true) | |
(def ^:const ONE_MEG (* 1024 1024)) | |
(deftype ByteArrayChunk [^bytes array ^int offset ^int end] | |
clojure.lang.IChunk |
OlderNewer