Skip to content

Instantly share code, notes, and snippets.

@pbalduino
Created March 25, 2014 14:57
Show Gist options
  • Select an option

  • Save pbalduino/9763538 to your computer and use it in GitHub Desktop.

Select an option

Save pbalduino/9763538 to your computer and use it in GitHub Desktop.
(defn fatorial [n]
{:pre [(> n 0)]}
(if (< n 2) 1
(* n (fatorial (dec n)))))
(fatorial 3)
; 6
(fatorial -2)
; AssertionError Assert failed: (> n 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment