Halt and catch fire: Difference between revisions

m
→‎{{header|Lua}}: added another
(→‎{{header|Lua}}: added Lua solution)
m (→‎{{header|Lua}}: added another)
Line 226:
 
=={{header|Lua}}==
Tricks could be used to shorten this, particularly in the interactive REPL, where <code>-_</code> would be enough (i.e., attempt to perform arithmetic on a nil global). This instead focuses on the "be useful elsewhere" aspect of the task, because it'sboth seem short-enough as-is:
<lang lua>error(1)</lang>
{{out}}
Line 232:
stack traceback:
[C]: in function 'error'
stdin:1: in main chunk
[C]: in ?</pre>
Or:
<lang lua>assert(false)</lang>
{{out}}
<pre>stdin:1: assertion failed!
stack traceback:
[C]: in function 'assert'
stdin:1: in main chunk
[C]: in ?</pre>
Anonymous user