Compile-time calculation: Difference between revisions
Content added Content deleted
m (→{{header|Sidef}}: modified code to work with Sidef 2.10) |
|||
Line 641: | Line 641: | ||
<lang perl6> say(BEGIN [*] 2..10);</lang> |
<lang perl6> say(BEGIN [*] 2..10);</lang> |
||
=={{header|Phix}}== |
|||
The Phix compiler uses constant folding/propagation, so running p -d on the following snippet |
|||
<lang Phix>integer a,b |
|||
a = 10*9*8*7*6*5*4*3*2*1 |
|||
b = factorial(10) |
|||
?{a,b}</lang> |
|||
produces a listing file containing |
|||
<pre> |
|||
; 1 integer a,b |
|||
; 2 a = 10*9*8*7*6*5*4*3*2*1 |
|||
mov [#0040278C] (a), dword 3628800 ;#0042904E: 307005 8C274000 005F3700 uv 00 00 1 15 |
|||
; 3 b = factorial(10) |
|||
mov ecx,5 ;#00429058: 271 05000000 vu 02 00 1 15 |
|||
mov edx,85 ;#0042905D: 272 55000000 uv 04 00 1 16 |
|||
call :%opFrame (factorial) ;#00429062: 350 0BE80000 v 00 00 1 16 |
|||
... |
|||
</pre> |
|||
{{out}} |
|||
<pre> |
|||
{3628800,3628800} |
|||
</pre> |
|||
=={{header|PicoLisp}}== |
=={{header|PicoLisp}}== |