Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
15
Task/Call-a-function/Clojure/call-a-function-4.clj
Normal file
15
Task/Call-a-function/Clojure/call-a-function-4.clj
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
(defn make-address
|
||||
([city place-name] (str place-name ", " city))
|
||||
([city street house-number] (str house-number " " street ", " city))
|
||||
([city street house-number apartment] (str house-number " " street ", Apt. " apartment ", " city)))
|
||||
|
||||
;; To call the function you just need to pass whatever arguments you are supplying as you would with a fixed number
|
||||
|
||||
;; First case- the queen doesn't need a street name
|
||||
(make-address "London" "Buckingham Palace"); => "Buckingham Palace, London"
|
||||
|
||||
;; Second case
|
||||
(make-address "London" "Downing Street" 10); => "10 Downing Street, London"
|
||||
|
||||
;; Third case
|
||||
(make-address "London" "Baker Street" 221 "B"); => "221 Baker Street, Apt. B, London"
|
||||
Loading…
Add table
Add a link
Reference in a new issue