RosettaCodeData/Task/Factorial/MANOOL/factorial-3.manool

13 lines
375 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
{ 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
}