Skip to content

Instantly share code, notes, and snippets.

View gmp26's full-sized avatar

Mike Pearson gmp26

View GitHub Profile
@gmp26
gmp26 / get-in.clj
Last active August 4, 2017 13:52 — forked from postspectacular/get-in.clj
get-in macro version
(defmacro get-in*
"Macro version of clojure.core/get-in without not-found fallback"
[root path]
(loop [root root, path path]
(if path
(recur `(get ~root ~(first path)) (next path))
root)))
(macroexpand-1 '(get-in* [[1 2 3] [3 4 [5 6 7 8]]] [1 2 3]))
;; (clojure.core/get (clojure.core/get (clojure.core/get [[1 2 3] [3 4 [5 6 7 8]]] 1) 2) 3)
(ns rum.core
(:refer-clojure :exclude [ref])
(:require-macros rum.core)
(:require
[cljsjs.react]
[cljsjs.react.dom]
[goog.object :as gobj]
[goog.functions :as gf]
[goog.array :as garr]
[rum.cursor :as cursor])
import React from 'react'
function defaultGetWidth () {
return window.innerWidth;
}
function defaultGetHeight () {
return window.innerHeight;
}