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
user=> (require 'cemerick.splice.rank) | |
nil | |
user=> (in-ns 'cemerick.splice.rank) | |
#<Namespace cemerick.splice.rank> | |
cemerick.splice.rank=> low | |
#cemerick.splice.rank.Rank[0] | |
cemerick.splice.rank=> high | |
#cemerick.splice.rank.Rank[2047] | |
cemerick.splice.rank=> (between low high) | |
#cemerick.splice.rank.Rank[1023] |
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 inkystarter | |
"Intro sketch for inky.cc, fork away." | |
(:require [inky.sketch :as sketch])) | |
(sketch/page-style! | |
(concat | |
sketch/default-styles | |
[:body {:font-family "'Helvetica Neue', Arial, sans-serif"} | |
:.sketch {:padding "30px"}])) |
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 almost.haiku | |
(:require [inky.sketch :as sketch] | |
[dommy.core :as dom] | |
[clojure.string :as str] | |
[cljs.core.async :as async | |
:refer [<! >! put! chan timeout]]) | |
(:require-macros [dommy.macros :refer [sel1 node]] | |
[cljs.core.async.macros :refer [go]])) | |
(enable-console-print!) |
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
(defmacro defrec [name args & body] | |
(let [indexed-args (interleave (iterate inc 0) args)] | |
`(defrecord ~name ~args | |
clojure.lang.Indexed | |
(nth [_# i#] | |
(case i# | |
~@indexed-args | |
(throw (IndexOutOfBoundsException.)))) | |
(nth [_# i# default#] | |
(case i# |
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
;; no exception when declare/defn are top-level (unsurprisingly) | |
=> (list | |
(declare ^:dynamic p) | |
(defn q [] @p)) | |
(#'user/p #'user/q) | |
=> (binding [p (atom 10)] | |
(q)) | |
#<ClassCastException java.lang.ClassCastException: clojure.lang.Var$Unbound cannot be cast to clojure.lang.IDeref> |
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
;; needs rummage to use as-set instead of as-collection... | |
(def clojure-encoding-map | |
(assoc enc/all-strings | |
:encode (fn encode | |
([k] (pr-str k)) | |
([k v] | |
[(pr-str k) (pr-str v)])) | |
:decode (fn | |
([k] (read-string k)) | |
([k v] [(read-string k) (read-string v)])))) |
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 a) | |
(use '[clojure.contrib.io :only (make-parents spit delete-file)]) | |
(use '[clojure.contrib.shell :only (sh)]) | |
(use '[clojure.contrib.str-utils :only (re-split str-join)]) | |
(defn- convert-fn-meta-into-javadoc | |
[impl-ns prefix mname pclasses rclass is-static?] | |
(let [m (meta (resolve (symbol (str (str impl-ns) "/" prefix (str mname))))) | |
{:keys [file line doc]} m |