Last active
November 11, 2022 07:21
-
-
Save lagenorhynque/fc0d478833a614cb0d32b7e222ebf871 to your computer and use it in GitHub Desktop.
self-introduction
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
(defrecord Profile [name | |
account | |
company | |
languages | |
interests | |
activities]) | |
(defn symbol->str [v] | |
(cond | |
(symbol? v) (name v) | |
(coll? v) (map symbol->str v) | |
:else v)) | |
(defmacro profile-body [& kvs] | |
`(reduce (fn [m# [k# v#]] (assoc m# k# (symbol->str v#))) | |
{} | |
(partition 2 '~kvs))) | |
(defmacro defprofile [name & body] | |
`(def ~name | |
(map->Profile (profile-body ~@body)))) | |
(defprofile lagénorhynque | |
:name "Kent OHASHI" | |
:account lagenorhynque | |
:company 株式会社オプト | |
:languages [Clojure Haskell Python Scala | |
English français Deutsch русский] | |
:interests [プログラミング 語学 数学] | |
:activities [読書 アニメ鑑賞 水族館巡り カラオケ アイススケート]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment