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/bash -e | |
bindir=`pwd`/bin-tmp | |
mkdir -p $bindir | |
export PATH=$bindir:$PATH | |
function use_ld() { | |
rm -f $bindir/ld | |
ln -s $1 $bindir/ld | |
echo "Using $1 for ld" | |
} |
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 fj | |
(:import [java.util.concurrent RecursiveTask | |
ForkJoinPool])) | |
(set! *warn-on-reflection* true) | |
;; ----------------------------------------------- | |
;; Helpers to provide an idiomatic interface to FJ | |
(defprotocol IFJTask |
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
(defmacro locals | |
"Returns a map of locals, as keywords, to their values." | |
[] | |
(let [locals (keys &env)] | |
`(zipmap ~@(map vec [(map keyword locals) locals])))) | |
(let [x 10] | |
(let [y 20 | |
z (+ x y)] | |
(locals))) |
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
/* | |
Silly example - close over s (say a string) returning an instance | |
of an anonymous type that acts like a ClojureScript collection | |
(defn make-conjable [s] | |
(reify | |
ICollection | |
(-conj [_ c] (str s c)))) | |
*/ |
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
;; 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. | |
(ns repl.test | |
(:require [clojure.browser.repl :as repl] |
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
(defn ->js [o] | |
(cond | |
(keyword? o) (name o) | |
(map? o) (let [out (js-obj)] | |
(doseq [[k v] o] | |
(aset out (->js k) (->js v))) | |
out) | |
(coll? o) (apply array (map ->js o)) | |
:else o)) |