Compile-time calculation: Difference between revisions
m
→{{header|Oforth}}
(Added EchoLisp) |
|||
Line 563:
<lang Oforth>10 seq reduce(#*) Constant new: FACT10
You can also calculate all factorials for 1 to 20 before defining fact method :
<lang Oforth>20 seq map(#[ seq reduce(#*) ]) Constant new: ALLFACTS
ALLFACTS println</lang>
|