Skip to content

Instantly share code, notes, and snippets.

@waywardmonkeys
Created April 5, 2015 14:58
Show Gist options
  • Save waywardmonkeys/56995b2738d6782e3dc9 to your computer and use it in GitHub Desktop.
Save waywardmonkeys/56995b2738d6782e3dc9 to your computer and use it in GitHub Desktop.
Factorial in Dylan using singleton types
define method factorial (n == 0) 1 end;
define method factorial (n == 1) 1 end;
define method factorial (n)
n * factorial(n - 1)
end;
format-out("%d", factorial(10));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment