Leiningen is the de facto clojure project and package manager. It can be installed via homebrew on OS X
brew install leiningenor just download the shell script and put it on your path. If ~/bin is on your path, then you would do:
| user=> (defn make-queue [elems] (into clojure.lang.PersistentQueue/EMPTY elems)) | |
| #'user/make-queue | |
| user=> (make-queue [1 2 3]) | |
| #<PersistentQueue clojure.lang.PersistentQueue@7861> | |
| user=> (set! *data-readers* {'p/q #'make-queue}) | |
| {p/q #'user/make-queue} | |
| user=> (read-string "#p/q [1 2 3]") | |
| #<PersistentQueue clojure.lang.PersistentQueue@7861> | |
| user=> #p/q [1 2 3] |
| (ns asm-test.test-class | |
| (:import [clojure.asm ClassWriter ClassVisitor Opcodes Type] | |
| [clojure.asm.commons GeneratorAdapter Method] | |
| [clojure.lang DynamicClassLoader Compiler RT])) | |
| (def cw (ClassWriter. ClassWriter/COMPUTE_MAXS)) | |
| (. cw (visit Opcodes/V1_5 Opcodes/ACC_PUBLIC | |
| "asm_test/test_class/TestClass" nil "java/lang/Object" (make-array String 0))) | |
| (let [m (Method. "doit" Type/VOID_TYPE (into-array Type [(Type/getType String)])) |
| (defmacro bit-ops | |
| [] | |
| `(do | |
| ~@(for [[s l] '[[<< bit-shift-left] | |
| [>> bit-shift-right] | |
| [>>> unsigned-bit-shift-right] | |
| [| bit-or] | |
| [& bit-and] | |
| [xor bit-xor] | |
| [!b bit-not]]] |
| # Docker | |
| dockervars="$HOME/.dockervars" | |
| function boot2docker { | |
| case "$1" in | |
| up|start|boot) | |
| command boot2docker "$@" | |
| command boot2docker shellinit > "$dockervars" 2> /dev/null | |
| source "$dockervars" | |
| ;; | |
| down|stop|halt) |
| isGen = (f) -> | |
| f? and f.constructor.name is 'GeneratorFunction' | |
| isIter = (f) -> | |
| f? and f.constructor.name is 'GeneratorFunctionPrototype' | |
| class Seq | |
| constructor: (it) -> | |
| if isGen it | |
| @_it = it() |
| fs = require 'fs' | |
| #request = require 'request' | |
| # | |
| request = ({uri}, done) -> | |
| done null, uri | |
| reqreq = (uris) -> | |
| for uri in uris | |
| yield ( (done) -> done null, uri ) |
| #!/usr/bin/env zsh | |
| set -e | |
| function nave_version_file { | |
| file="$(pwd)/.nave-version" | |
| if [ -f "$file" ]; then | |
| echo "$file" | |
| elif `git rev-parse &>/dev/null`; then | |
| file="$(git rev-parse --show-toplevel)/.nave-version" |
| /** | |
| * Copyright (c) Rich Hickey. All rights reserved. | |
| * The use and distribution terms for this software are covered by the | |
| * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) | |
| * which can be found in the file epl-v10.html at the root of this distribution. | |
| * By using this software in any fashion, you are agreeing to be bound by | |
| * the terms of this license. | |
| * You must not remove this notice, or any other, from this software. | |
| **/ |
| module Interpreter | |
| import Data.Fin | |
| import Data.Vect | |
| data Ty = TyInt | |
| | TyBool | |
| | TyStr | |
| | TyFun Ty Ty | |