Created
February 6, 2016 14:57
-
-
Save realeroberto/38f9ada5628af0b28dec to your computer and use it in GitHub Desktop.
My first attempt at "coding" in Standard ML.
This file contains hidden or 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
(* factorial *) | |
(* my first Standard ML ``program'' *) | |
(* see the excellent tutorial at *) | |
(* http://www.soc.napier.ac.uk/course-notes/sml/manual.html *) | |
fun factorial(1) = 1 | |
| factorial(n) = n * factorial(n-1); | |
print (Int.toString(factorial(10))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment