13 lines
375 B
Text
13 lines
375 B
Text
|
|
{ let
|
||
|
|
{ Fact = -- compile-time constant binding
|
||
|
|
{ proc { N } as -- precondition: N.IsI48[] & (N >= 0)
|
||
|
|
: var { Res = 1 } in -- variable binding
|
||
|
|
: do Res after -- return result
|
||
|
|
: while N <> 0 do -- loop while N does not equal to zero
|
||
|
|
Res = N * Res; N = N - 1
|
||
|
|
}
|
||
|
|
}
|
||
|
|
in -- use Fact here or just make the whole expression to evaluate to it:
|
||
|
|
Fact
|
||
|
|
}
|