Skip to content

Instantly share code, notes, and snippets.

@practicalli-johnny
Last active November 8, 2016 06:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save practicalli-johnny/7dc42d57506ab9b82d3016659eaacfa0 to your computer and use it in GitHub Desktop.
Save practicalli-johnny/7dc42d57506ab9b82d3016659eaacfa0 to your computer and use it in GitHub Desktop.
Simple examples of writing your own functions
(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