kamby icon indicating copy to clipboard operation
kamby copied to clipboard

Make `exit` available in scripts

Open stasoid opened this issue 2 years ago • 1 comments

stasoid avatar Dec 28 '22 00:12 stasoid

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.

stasoid avatar Mar 03 '23 04:03 stasoid