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 react-fun.part1) | |
;;Deconstructing React | |
;; v = f (d) | |
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
(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))))) |
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 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]]))) |