Halt and catch fire: Difference between revisions

Added Easylang
imported>Tromp
(diverge in BLC)
(Added Easylang)
 
(5 intermediate revisions by 3 users not shown)
Line 100:
gawk: C:\AWK\HALT_AND_CATCH_FIRE.AWK:5: error: division by zero attempted
</pre>
 
=={{header|C}}==
<syntaxhighlight lang="c">int main(){int a=0, b=0, c=a/b;}</syntaxhighlight>
 
=={{header|Binary Lambda Calculus}}==
BLC forces normal programs to start with a closed lambda term, by mapping free variables to the divergent Omega = <code>(\x.x x)(\x.x x)</code>, the lambda calculus equivalent of an infinite loop. That makes the following 2-bit BLC program the smallest to catch fire:
 
<pre>10</pre>
</syntaxhighlight>10</syntaxhighlight>
 
=={{header|BQN}}==
Line 115 ⟶ 112:
 
Other runtime errors are possible, but not as easy to use.
 
=={{header|Bruijn}}==
Bruijn does not have runtime errors. For debugging you can either write tests (which are run before evaluating main) or use tactical infinite loops:
<syntaxhighlight lang="bruijn">
:test ([[0]]) ([[1]])
 
main [[0 0] [0 0]]
</syntaxhighlight>10</syntaxhighlight>
 
=={{header|C}}==
<syntaxhighlight lang="c">int main(){int a=0, b=0, c=a/b;}</syntaxhighlight>
 
=={{header|C++}}==
Line 160 ⟶ 168:
<pre>
 
</pre>
 
=={{header|EasyLang}}==
<syntaxhighlight>
a[] = [ ]
print a[1]
</syntaxhighlight>
{{out}}
<pre>
*** ERROR: index out of bounds
</pre>
 
1,981

edits