Compile-time calculation: Difference between revisions

m
→‎{{header|Sidef}}: modified code to work with Sidef 2.10
m (→‎{{header|Sidef}}: modified code to work with Sidef 2.10)
Line 795:
=={{header|Sidef}}==
The compile-time evaluation is limited at a constant expression, which cannot refer at any other user-defined data, such as variables or functions.
<lang ruby>define n = (10!);
say n;</lang>
 
or:
<lang ruby>define n = (func(n){ n > 0 ? __FUNC__(n-1)*n : 1 }(10));
say n;</lang>
 
2,747

edits