Halt and catch fire: Difference between revisions
Content added Content deleted
(→{{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
<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>
|