From 51daa0cdfa52acf4d884a152e113ce34066d4109 Mon Sep 17 00:00:00 2001 From: Matthew Davidson Date: Wed, 4 Jan 2023 15:11:49 +0100 Subject: [PATCH] 19 --- src/koans/19_datatypes.clj | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/koans/19_datatypes.clj b/src/koans/19_datatypes.clj index d6eb31f..28a4be1 100644 --- a/src/koans/19_datatypes.clj +++ b/src/koans/19_datatypes.clj @@ -18,28 +18,30 @@ (deftype Razzie [category] Award (present [this recipient] - __)) + (print (str "You're really the " + category ", " + recipient "... sorry.")))) (meditations "Holding records is meaningful only when the record is worthy of you" - (= __ (.prize (Nobel. "peace"))) + (= "peace" (.prize (Nobel. "peace"))) "Types are quite similar" - (= __ (.prize (Pulitzer. "literature"))) + (= "literature" (.prize (Pulitzer. "literature"))) "Records may be treated like maps" - (= __ (:prize (Nobel. "physics"))) + (= "physics" (:prize (Nobel. "physics"))) "While types may not" - (= __ (:prize (Pulitzer. "poetry"))) + (= nil (:prize (Pulitzer. "poetry"))) "Further study reveals why" - (= __ + (= '(true false) (map map? [(Nobel. "chemistry") (Pulitzer. "music")])) "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"))) "Surely we can implement our own by now"