Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
21
Task/Call-a-function/Clojure/call-a-function-11.clj
Normal file
21
Task/Call-a-function/Clojure/call-a-function-11.clj
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
;; They are indistinguishable in Clojure, and you can even override a built in one
|
||||
|
||||
;; Using built-in addition
|
||||
|
||||
(+ 5 5); => 10
|
||||
|
||||
;; Using custom defined addition
|
||||
|
||||
(defn ? [a b]
|
||||
"Returns the sum of two numbers"
|
||||
(+ a b))
|
||||
|
||||
(? 5 5); => 10
|
||||
|
||||
;; Overriding a built in function is possible but not recommended
|
||||
|
||||
(defn * [a b] ;; Redefining the multiplication operator
|
||||
"Returns the sum of two numbers"
|
||||
(+ a b))
|
||||
|
||||
(* 5 5); => 10
|
||||
Loading…
Add table
Add a link
Reference in a new issue