Skip to content

Instantly share code, notes, and snippets.

View zajac's full-sized avatar

Andrey Zaytsev zajac

  • JetBrains
  • Munich
View GitHub Profile
@zajac
zajac / part1.clj
Last active April 28, 2017 13:35
Deconstructing React
(ns react-fun.part1)
;;Deconstructing React
;; v = f (d)
(defn longest [xs ys] (if (> (count xs) (count ys)) xs ys))
(defn xxx [[x & xs] [y & ys]]
(cond
(or (nil? x) (nil? y)) nil
(= x y) (cons x (xxx xs ys))
:else (longest (xxx (cons x xs) ys) (xxx xs (cons y ys)))))
(ns ot.core
(:require
#?(:clj
[clojure.core.match :refer [match]])
#?(:cljs
[cljs.core.match :refer-macros [match]]))
#?(:clj
(:gen-class
:methods [^:static [compose [clojure.lang.IPersistentVector clojure.lang.IPersistentVector] clojure.lang.IPersistentVector]
^:static [transformIdx [java.lang.Integer clojure.lang.IPersistentVector] java.lang.Integer]])))