Created
February 14, 2022 16:05
-
-
Save reevik/9335339a240c1466dc635b942097afca to your computer and use it in GitHub Desktop.
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
;; Multimethod definition showing that the run | |
;; might have multiple informations. The identity | |
;; function is used as dispatcher function to | |
;; determine which implementation of run is to be | |
;; called | |
(defmulti run identity) | |
;; The run method implementation for temp. | |
(defmethod run "temp" | |
[city day] | |
(get-temp city day)) | |
;; Reads humidity. | |
(defmethod run "humidity" | |
[city day] | |
(get-humidity city day)) | |
;; Reads wind. | |
(defmethod run "windspeed" | |
[city day] | |
(get-windspeed city day)) | |
;; you are encouraged to add more functions. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment