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 react-cljs.core | |
(:require React)) | |
(declare render) | |
(defn handle-change [e] | |
(render {:text (.. e -target -value)})) | |
(defn render [{:keys [text]}] | |
(React/renderComponent |
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 async-match.core | |
(:require-macros [cljs.core.match.macros :refer [match]] | |
[cljs.core.async.macros :refer [go]]) | |
(:require [cljs.core.match] | |
[cljs.core.async :refer [<!]])) | |
(defn foo [in] | |
(go (while true | |
(let [[e c] (<! in)] | |
(match [e] |
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
<html> | |
<body> | |
<script src="resources/js/out/goog/base.js" type="text/javascript"></script> | |
<script src="resources/js/example.js" type="text/javascript"></script> | |
<script type="text/javascript">goog.require("example.core");</script> | |
</body> | |
</html> |
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 logic-ast.core | |
(:refer-clojure :exclude [==]) | |
(:require [clojure.java.io :as io] | |
[clojure.pprint :as pp] | |
[cljs.env :as env] | |
[cljs.analyzer.utils :as u] | |
[cljs.analyzer :as ana] | |
[clojure.core.logic | |
:refer [run run* conde == fresh lcons partial-map defne] :as l] | |
[clojure.core.logic.pldb :as pldb])) |
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 epoch.core | |
(:require-macros [epoch.macros :refer [check]]) | |
(:require [goog.object :as gobject])) | |
(enable-console-print!) | |
(def ^:dynamic *parent* nil) | |
(defprotocol IToEpoch | |
(-to-epoch [this])) |
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 purgatory.core | |
(:require-macros [purgatory.macros :refer [check]]) | |
(:require [goog.object :as gobject])) | |
(enable-console-print!) | |
(def ^:dynamic *parent* nil) | |
(defprotocol ITrappable | |
(-trap [this])) |
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 datomic-cljs.http | |
(:require [datomic-cljs.impl.browser.request :as request :target :browser] | |
[datomic-cljs.impl.node.request :as request :target :nodejs] | |
shared-requires)) |
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 [x (cons 1 nil)] | |
(+ x 1)) | |
;; WARNING: cljs.core/+, all arguments must be numbers, got [cljs.core/Cons number] instead. | |
(let [x (interleave (repeat "foo") (repeat "bar"))] | |
(+ x 1)) | |
;; WARNING: cljs.core/+, all arguments must be numbers, got [cljs.core/LazySeq number] instead. |
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 computer-down? [{{computer-y :y} :computer | |
{ball-y :y} :ball player-height :player-height :as state}] | |
(and (> (- computer-y 20) ball-y) (>= (- computer-y (/ player-height 2)) 0))) | |
;; vs. | |
(defn computer-down? [{:keys [ball computer] :as st}] | |
(let [cy (:y computer)] | |
(and (> (- cy 20) (:y ball)) | |
(>= (- cy (/ (:player-height st) 2)) 0)))) |
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
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func f() { | |
messages := make(chan string) |