|
ToDo:
|
少し時間があったので久しぶりにClojureの復習
user> (defprotocol MyInterface
(method01 [this])
(method02 [this a b]))
MyInterface
user> (defrecord MyClass [prop01 prop02]
MyInterface
(method01 [this] (println prop01))
(method02 [this a b] (println (str a b prop02))))
user.MyClass
user> (->MyClass "a" "b")
#user.MyClass{:prop01 "a", :prop02 "b"}
user> (def a (->MyClass "a" "b"))
#'user/a
user> (.method01 a)
a
nil
user> (.method02 a "d" "e")
deb
nil