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
;; My good-enough glomming together of clojure.test and test.generative | |
(ns cemerick.generative | |
(:require [clojure.test.generative.generators :as gens] | |
[clojure.test.generative :as gen]) | |
(:use clojure.test)) | |
;; Too bad last-report isn't sent an action upon success as well. | |
;; Perhaps this should just be replaced with a try/catch/rethrow | |
;; around the body in defspectest |
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
;; ## Changes from cljs.repl.browser | |
;; | |
;; * Multiple concurrent browser-REPLs can be safely used | |
;; * The browser-REPL's HTTP server is now always-on | |
;; * Each browser-REPL session supports a new top-level "entry" URL that | |
;; can be used to easily start the REPL in a browser or other JS runtime | |
;; (i.e. you don't need to have a separate webapp running to initiate the | |
;; browser-REPL connection) | |
;; * The entry (and REPL) URLs are available in slots on the browser-REPL's | |
;; environment, making it trivial to automate browser-REPL sessions |
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
; using https://code.google.com/p/language-detection/ | |
; i.e. [com.cybozu.labs/langdetect "1.1-20120112"] | |
(require '[clojure.java.io :as io]) | |
(->> #{"af" "ar" "bg" "bn" "cs" "da" "de" "el" "en" "es" "et" "fa" "fi" "fr" "gu" | |
"he" "hi" "hr" "hu" "id" "it" "ja" "kn" "ko" "lt" "lv" "mk" "ml" "mr" "ne" | |
"nl" "no" "pa" "pl" "pt" "ro" "ru" "sk" "sl" "so" "sq" "sv" "sw" "ta" "te" | |
"th" "tl" "tr" "uk" "ur" "vi" "zh-cn" "zh-tw"} | |
(map (partial str "profiles/")) |
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 whatever.cljs | |
(:require [cljs.compiler :refer (munge)]) | |
(:refer-clojure :exclude (munge defonce))) | |
(defmacro defonce | |
[vname expr] | |
(let [ns (-> &env :ns :name name munge) | |
mname (munge (str vname))] | |
`(when-not (.hasOwnProperty ~(symbol "js" ns) ~mname) | |
(def ~vname ~expr)))) |
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
let asprintf_nm x = | |
let open Format in | |
let fns = get_formatter_out_functions () in | |
try | |
set_formatter_out_functions {fns with out_newline = Fun.const () ; out_indent = Fun.const ()}; | |
asprintf x | |
with exn -> | |
set_formatter_out_functions fns; | |
raise exn |
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
; in ~/.live-packs/$YOURNAME-pack/init.el | |
; not using `eval-after-load` because doing so appears to affect only the keywords associated | |
; with the first "type" of Clojure file you open (i.e. .clj or .cljs); this should knock out | |
; the special formatting on every buffer that ever has clojure-mode applied to it | |
(add-hook 'clojure-mode-hook | |
(lambda () | |
(font-lock-remove-keywords | |
nil `(("(\\(fn\\)[\[[:space:]]" | |
(0 (progn (compose-region (match-beginning 1) | |
(match-end 1) "λ") |
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
;; Records are just types that provide default implementations of certain | |
;; key interfaces that allow them to stand in for maps. | |
;; This set of interfaces/protocols is not closed though; you can certainly make them | |
;; useful in places where maps aren't, e.g. w/ sequential destructuring: | |
=> (defrecord Point [x y] | |
clojure.lang.Indexed | |
(nth [_ i] (case i 0 x 1 y | |
(throw (IndexOutOfBoundsException.)))) | |
(nth [_ i default] |
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
Fatal error: exception Vendor.Helpers.InvalidReference("unknown qualifier `(-'") | |
Raised at file "vendor/odoc_parser/helpers.ml", line 28, characters 14-72 | |
Called from file "vendor/odoc_parser/helpers.ml", line 258, characters 28-47 | |
Called from file "vendor/odoc_parser/syntax.ml", line 138, characters 47-71 | |
Called from file "vendor/odoc_parser/syntax.ml", line 340, characters 20-66 | |
Called from file "vendor/odoc_parser/syntax.ml", line 358, characters 16-34 | |
Called from file "vendor/odoc_parser/syntax.ml", line 365, characters 17-54 | |
Called from file "vendor/odoc_parser/syntax.ml", line 727, characters 18-33 | |
Called from file "vendor/odoc_parser/syntax.ml", line 1103, characters 6-71 | |
Called from file "vendor/odoc_parser/error.ml", line 62, characters 9-15 |
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
type k = [ `A of int | `B of string | `Ks of (string fn * k) list ] | |
and 'a fn = 'a -> k -> bool | |
(* Error: In the definition of k, type string fn should be 'a fn *) |
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
module Foo : sig | |
type t = private [ `A | `B ] | |
end = struct | |
type t = [ `A ] | |
end |
NewerOlder