loom
1// Module interface declaration
2interface Factorial : immutable {
3func factorial(int n) -> int f
4: pure,
5pre (n > 0),
6post (f > 0 && f < 1000000)
7}
8
9// Defining module functions
10func factorial(int n)
11-> int
12{
13return (n == 1) ? 1 : n*factorial(n-1)
14}
15
16