Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
(defn absolute-value
[x]
(if (< x 0) ;; Condition
(* -1 x) ;; Consequence
x)) ;; Alternative
(absolute-value -1)
=> 1
(absolute-value 1)
=> 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment