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-10.clj
Normal file
15
Task/Call-a-function/Clojure/call-a-function-10.clj
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
;;You can assign it to a variable:
|
||||
|
||||
(def receipt-us (format-receipt "Toilet Paper" 5 format-price-us))
|
||||
|
||||
;; Then the variable holds the value
|
||||
receipt-us; => "Toilet Paper $5"
|
||||
|
||||
;; Or you can use it in a call to another function
|
||||
|
||||
(defn add-store-name [receipt]
|
||||
"A function to add a footer to the receipt"
|
||||
(str receipt "\n Thanks for shopping at Safeway" ))
|
||||
|
||||
;; Calls add-store-name with the result of the format function
|
||||
(add-store-name (format-receipt "Toilet Paper" 5 format-price-us)); => "Toilet Paper $5\n Thanks for shopping at Safeway"
|
||||
Loading…
Add table
Add a link
Reference in a new issue