(exit) requiring arguments when compiled
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.
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...
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
exitto an implementation-specific primitive (_exit,haltor such), assuming we still need this functionality as a primitive. - Add a full implementation of
exitto theprocess-contextlibrary where it belongs.