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 ast | |
(:use [clojure.core.match :only [match]] ) | |
(:require [clojureql.predicates :as pred])) | |
(comment These protocols are from a former iteration. They capture the intention pretty well | |
and might be reintroduced, as soon the format is stable. | |
(defprotocol SqlCompilable | |
(render [this] "Sequence of strings that represent the prepared statement") | |
(param-count [this] "Number of positional parameters in expression or relation") | |
(label [this] "Canonical label of expression or relation")) |
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 jit-memoize [query-fn] | |
(let [cache-agent (agent {})] | |
(letfn | |
[(add-listener [queries parameter callback] | |
(if-let [listeners (queries parameter)] | |
(assoc queries parameter | |
(cons callback listeners)) | |
(add-query queries parameter callback))) | |
(add-query [queries parameter callback] | |
(future (send cache-agent |
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
;; The macros | |
;; most macros here alias names from select.cljs | |
;; they will get used in regular calls | |
(ns lib.select | |
(:require | |
[clojure.string :as str])) | |
;; selector syntax | |
(defn intersection [preds] |
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 workbench.enlive.predicate | |
(:require | |
[clojure.zip :as z] | |
[workbench.enlive.engine | |
:refer [compile-step]] | |
[workbench.enlive.select | |
:refer [zip-select]])) | |
;; ## Builtin predicates | |
;; |
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
(let [m {0 :z 1 :o 2 :t 3 :th}] | |
(run* [q] | |
(fresh [r] | |
(fd/in r (fd/interval 1 2)) | |
(featurec m {r q})))) |
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
From 85fd5c4f3c20c1a557c2da7d06b0c1b41e9533f9 Mon Sep 17 00:00:00 2001 | |
From: Herwig Hochleitner <[email protected]> | |
Date: Mon, 11 Mar 2013 03:57:43 +0100 | |
Subject: [PATCH] Throw exception instead of trying to throw string in | |
defmulti compiler macro | |
--- | |
src/clj/cljs/core.clj | 2 +- | |
1 file changed, 1 insertion(+), 1 deletion(-) |
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
(def path-cache (atom {})) | |
(defn load-cached [path] | |
(if-let [ret (get @path-cache path)] | |
ret | |
(let [ret (cell nil)] | |
(swap! path-cache assoc path ret) | |
(XhrIo/send path | |
(fn [e] | |
(case (.. e -target getStatus) |
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 util.curry) | |
(defn feed-curry [f arg args] | |
(if (pos? (count args)) | |
(recur (f arg) (first args) (rest args)) | |
(f arg))) | |
(defn- curried-fn-body [name args body] | |
{:pre [(pos? (count args))]} | |
(let [arg (first args) |
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
function $cljs$core$PersistentArrayMap$$($meta$$20$$, $cnt$$9$$, $arr$$73$$, $__hash$$11$$) { | |
this.$meta$ = $meta$$20$$; | |
this.$cnt$ = $cnt$$9$$; | |
this.$arr$ = $arr$$73$$; | |
this.$__hash$ = $__hash$$11$$; | |
this.$cljs$lang$protocol_mask$partition1$$ = 4; | |
this.$cljs$lang$protocol_mask$partition0$$ = 16123663 | |
} | |
$JSCompiler_prototypeAlias$$ = $cljs$core$PersistentArrayMap$$.prototype; | |
$JSCompiler_prototypeAlias$$.$cljs$core$IEditableCollection$_as_transient$arity$1$ = function $$JSCompiler_prototypeAlias$$$$cljs$core$IEditableCollection$_as_transient$arity$1$$() { |
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 dev | |
(:require | |
cemerick.austin cemerick.austin.repls webnf.server | |
[net.cgrand.enlive-html :refer [deftemplate content set-attr]] | |
[net.cgrand.moustache :refer [app]] | |
[ring.util.response :refer [not-found]] | |
[ring.middleware.file :refer [wrap-file]])) | |
(def repl-env) |