Created
March 6, 2022 15:59
-
-
Save bristermitten/d1dd18a626d20c0a50fa329e5ec08541 to your computer and use it in GitHub Desktop.
enterprise clojure
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 enterprise.core | |
(:require [clojure.string :as str]) | |
(:gen-class)) | |
(def names ["event" "parameter" "factory" "service" "builder" "executor" "implementation" "impl" "predicate" "delegate" "resolver" "exporter" "abstract" "boostrap" "bean" "visitor" "method" "interpreter" "template" "advisor" "adapter" "object" "candiate" "context" "pattern" "exception" "component" | |
"utils" "mapper" "adapter" "pool" "response" "listener"]) | |
(def prefixes ["I" "Abstract" "Stub" "Mock" "Delegating" ""]) | |
(defn rand-prefix [] (rand-nth prefixes)) | |
(defn random-name [] | |
(let [amount (rand-int (count names))] | |
(->> (repeatedly amount #(rand-nth names)) | |
(cons (rand-prefix)) | |
(map str/capitalize) | |
(str/join "")))) | |
(defn -main [& args] | |
(let [num (or (some-> (first args) (Integer/parseInt)) 1)] | |
(println "===" num "Enterprise-Ready Class Names ===") | |
(->> (repeatedly random-name) | |
(take num) | |
(run! println)) | |
(println (str/join "" (repeat 40 "="))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment