Compile-time calculation: Difference between revisions

m
Line 497:
func: newFunction { FACT10 println }</lang>
 
You can evenalso calculate all factorials for 1 to 20 before defining fact method :
<lang Oforth>20 seq map(#[ seq reduce(#*) ]) Constant new: ALLFACTS
 
func: fact(n) { ALLFACTS at(n) }</lang>
 
1,015

edits