Compile-time calculation: Difference between revisions

Content added Content deleted
m (elided NetRexx from omit list.)
(Added Quackery.)
Line 1,062:
could on a x86 be complied to
<pre>MOV dword [v_a],3628800</pre>
 
=={{header|Quackery}}==
 
To compute and print 10! during compilation:
 
<lang Quackery>[ 1 10 times [ i 1+ * ] echo ] now!</lang>
 
To compute 10! during compilation and print the result at runtime:
 
<lang Quackery>[ 1 10 times [ i 1+ * ] ] constant echo</lang>
 
Any Quackery code can be executed during compilation, but the programmer must bear in mind that the compiler uses the stack, so executed code should have no overall stack effect in the case of <code>now!</code>, or leave a single item on the stack to be compiled in the case of <code>constant</code>.
 
=={{header|Racket}}==