3 ms·
Hello, World test case: bash$ while true ; do : ; done ^C bash$
by kazinator 10y ago
Hello, World test case:
bash$ while true ; do : ; done
^C
bash$
- chubot 10y agoGood tip, thanks! I think you can use any of C++ exceptions, explicit returns, or setlongjmp(). setlongjmp() doesn't work well with C++ destructors. The interpreter loop just has to check for a flag set by the signal handler and then pop back to the interactive loop. I noticed that the Lua parser uses setlongjmp() when compiled as C, but C++ exceptions when compiled as C++.