This function computes the English string for any given integer supported by Clojure.
(int->str 110917) ; "one hundred and ten thousand nine hundred and seventeen"
(ns example.factory.aws.cloudformation | |
(:require [clojure.data.json :as json])) | |
(defn apply-stack-fn | |
[create-fn update-fn] | |
(fn apply-stack | |
[payload] | |
(try | |
(create-fn payload) | |
(catch AlreadyExistsException e |
(ns atbash.core | |
(require [clojure.string :refer [join lower-case]])) | |
(def lookup | |
(let [alphabet "abcdefghijklmnopqrstuvwxyz"] | |
(zipmap alphabet (reverse alphabet)))) | |
(defn encode | |
[s] | |
(->> (lower-case s) |
(defn def? | |
[[a b]] | |
(if (#{'defn 'def} a) b)) | |
(defmacro progn | |
[& sexps] | |
(let [names (->> sexps (filter def?) (map def?))] | |
`(do | |
(declare ~@names) | |
~@sexps))) |
(ns roman.core) | |
(defmacro defpairs | |
"Helper macro to make ordered defs for pairs nicer." | |
[varname pairs] | |
`(def ~varname | |
(partition 2 ~pairs))) | |
(defpairs digits | |
["M" 1000 |