Factorial in CPL
Example for versions
CPL
(Example from language description) This is a recursive factorial definition (note the rec
modifier which stresses this). To implement different processing scenarios for different values of x
, a conditional expression is used instead of if
.
rec function Fact1[x] = (x = 0) → 1, xFact1[x — 1]
Comments
]]>blog comments powered by Disqus
]]>