kamby
kamby copied to clipboard
Make `exit` available in scripts
This is purely recreational activity.
The need for exit
arose when I tried to add Kamby to this polyglot.
It has a rule that ... the program must exit normally (e.g. by running off the end of the program, or via a command such as exit that performs normal program termination)
.
The problem is, without exit
it is hard to check if this rule is applied.
I can easily check if the program prints the required number, but how do I know if the interpreter reached the end of the program or it encountered error somewhere after print statement?
The esiest way to ensure this is to call exit
immediately after puts
.
Another solution would be for interpreter to exit with nonzero error code if it encounters fatal error.