Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make exit available in scripts #6

Closed
wants to merge 1 commit into from

Conversation

stasoid
Copy link

@stasoid stasoid commented Dec 28, 2022

No description provided.

Copy link
Owner

@henriquegogo henriquegogo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need an "exit" command in script?

@stasoid
Copy link
Author

stasoid commented Mar 3, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants