Last active
November 8, 2016 06:01
-
-
Save practicalli-johnny/7dc42d57506ab9b82d3016659eaacfa0 to your computer and use it in GitHub Desktop.
Simple examples of writing your own functions
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
(defn add-ten | |
"A simple function to add two specific numbers" | |
[] | |
(+ 3 10)) | |
(add-ten) | |
;; => 13 | |
(defn add-ten | |
"A simple function to add 10 to a given number" | |
[number] | |
(+ number 10)) | |
(add-ten 4) | |
;; => 14 | |
(defn add-numbers | |
"A simple function to add two given numbers" | |
[number-1 number-2] | |
(+ number-1 number-2)) | |
(add-numbers 5 10) | |
;; => 15 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment