;;(debug t nil)
'(1 2 3)
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
;; Various Operators on Pure Functions | |
;; | |
;; Open source Liscence and all that | |
(ns | |
"Collection of Operators on Pure Functions" | |
{:author "Robert McIntyre"} | |
mobius.utils.function-utils | |
(:use [clojure.contrib.profile])) |
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 | |
mobius.utils.function-utils | |
"Collection of Operators on Pure Functions" | |
{:author "Robert McIntyre"} | |
(:use [clojure.contrib.profile])) | |
(defn mix | |
" Takes any number of mathematically equal functions with possibly different run-time properties and | |
returns a function that runs each in a separate thread, returns the result from the first thread |
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 rlm.shell-write | |
(:refer-clojure :exclude [spit] ) | |
(:use [clojure.contrib duck-streams command-line str-utils shell-out repl-utils]) | |
(:import (java.io File BufferedReader ByteArrayOutputStream InputStreamReader)) | |
(:import (org.apache.commons.exec PumpStreamHandler DefaultExecutor ExecuteWatchdog CommandLine))) | |
(defn sw | |
"same as sh but uses apache-commons to actually execute the process, | |
and prints output as soon as the subprocess returns output. Prints all |
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 sunil.curry) | |
(defn partial+ | |
"Takes a function f and fewer than the normal arguments to f, and | |
returns a fn that takes a variable number of additional args. When | |
called, the returned function calls f with args + additional args. | |
differs from the core version in that it works on just one argument." | |
{:added "1.0"} | |
([f] f) | |
([f arg1] |
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 rlm.rlm-commands | |
(:require [clojure.contrib [duck-streams :as ds]]) | |
(:use [clojure.contrib java-utils])) | |
(defmacro undef | |
"removes symbol from the current namespace" | |
[symbol] | |
`(ns-unmap *ns* (quote ~symbol))) | |
(defmacro ns-nuke |
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
(defmulti redis class) | |
(defmethod redis java.lang.Integer [x] x) | |
(defmethod redis java.lang.Double [x] | |
(let [res (if (< (- x (int (floor x))) 0.01) | |
(int x) | |
(/ x 2))] | |
(println x) | |
(fn [] ((get-method redis ((.dispatchFn redis) res)) res)) |
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
(import '(java.io File BufferedReader ByteArrayOutputStream InputStreamReader)) | |
(def println-repl (bound-fn* println)) | |
(defn sh-seq |
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 rlm.classpath-utils | |
(:require [clojure.contrib [duck-streams :as ds]]) | |
(:use [clojure.contrib java-utils])) | |
(defn classpath [] | |
(get-system-property "java.class.path")) | |
(defn add-to-classpath [file-name] |
OlderNewer