This commit is contained in:
Matthew Davidson 2023-01-04 15:11:49 +01:00
parent e5ec500e01
commit 51daa0cdfa

View file

@ -18,28 +18,30 @@
(deftype Razzie [category] (deftype Razzie [category]
Award Award
(present [this recipient] (present [this recipient]
__)) (print (str "You're really the "
category ", "
recipient "... sorry."))))
(meditations (meditations
"Holding records is meaningful only when the record is worthy of you" "Holding records is meaningful only when the record is worthy of you"
(= __ (.prize (Nobel. "peace"))) (= "peace" (.prize (Nobel. "peace")))
"Types are quite similar" "Types are quite similar"
(= __ (.prize (Pulitzer. "literature"))) (= "literature" (.prize (Pulitzer. "literature")))
"Records may be treated like maps" "Records may be treated like maps"
(= __ (:prize (Nobel. "physics"))) (= "physics" (:prize (Nobel. "physics")))
"While types may not" "While types may not"
(= __ (:prize (Pulitzer. "poetry"))) (= nil (:prize (Pulitzer. "poetry")))
"Further study reveals why" "Further study reveals why"
(= __ (= '(true false)
(map map? [(Nobel. "chemistry") (map map? [(Nobel. "chemistry")
(Pulitzer. "music")])) (Pulitzer. "music")]))
"Either sort of datatype can define methods in a protocol" "Either sort of datatype can define methods in a protocol"
(= __ (= "Congratulations on your Best Picture Oscar, Evil Alien Conquerors!"
(with-out-str (present (Oscar. "Best Picture") "Evil Alien Conquerors"))) (with-out-str (present (Oscar. "Best Picture") "Evil Alien Conquerors")))
"Surely we can implement our own by now" "Surely we can implement our own by now"