Skip to content

Instantly share code, notes, and snippets.

View Seberius's full-sized avatar

Kaijah Hougham Seberius

View GitHub Profile
@Seberius
Seberius / bignum.cljs
Last active August 29, 2015 14:09
ClojureScript Factory Pattern Example
(definterface IBigInt
(add this y)
(subtract this y)
(multiply this y)
(divide this y))
(defprotocol BigInt [signum magnitude]
IBigInt
(add (add this y))
(subtract (sub this y))
@Seberius
Seberius / decorator.clj
Last active June 11, 2017 15:43
dev/reno - Decorator pattern in Clojure/script
(ns patterns.decorator.core
(:require [clojure.data.json :as json]
[clojure.string :as str]
[patterns.util :refer [to-xml]]))
;; Record impl
(defprotocol IRenderable
(render [this]))
(defrecord WebService [data]