RosettaCodeData/Task/Factorial/MANOOL/factorial-3.manool
2023-07-01 13:44:08 -04:00

12 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
}