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

(exit) requiring arguments when compiled #542

Open
Retropikzel opened this issue Aug 11, 2024 · 2 comments
Open

(exit) requiring arguments when compiled #542

Retropikzel opened this issue Aug 11, 2024 · 2 comments
Assignees

Comments

@Retropikzel
Copy link

When script is compiled, run and it constains call to exit without arguments an error is thrown:

Error: Expected at least 1 arguments to exit but received 0:

I've made an reproducable example here https://github.com/Retropikzel/cyclone-bug-reporting, but it should be quite trivial to repoduce it manually.

The example is run with:
bash exit-args.sh

R7RS says about exit on page 60:
If no argument is supplied, or if obj is #t, the exit procedure should communicate to the operating system that the program exited normally.

@justinethier
Copy link
Owner

Thanks for the report! I was hoping this would be a quick fix but there are complications with how exit is implemented in the runtime. Still, will take a closer look...

@justinethier justinethier self-assigned this Aug 20, 2024
@justinethier
Copy link
Owner

The problem here is that exit is currently a primitive that cannot easily be modified to be a variadic procedure, due to implementation reasons. The right solution is to:

  • Convert the primitive exit to an implementation-specific primitive (_exit, halt or such), assuming we still need this functionality as a primitive.
  • Add a full implementation of exit to the process-context library where it belongs.

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

No branches or pull requests

2 participants