You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was just merged in #82. However, the new code is not quite correct:
parse_argv raises exceptions instead of internally executing exit.
parse_argv should be called with ~current:(ref 0).
Perhaps the right way to do this is to restore the former signature of run_main, and leave it as the function that calls exit, and provide a new function run_main_with_argv that will take an argv argument and raise exceptions. I actually would prefer run_main_with_argv not call exit, because that allows linking a PPX directly into a test suite, which improves testing performance.
Another option is to leave run_main with ?argv, but it will be have differently, depending on whether ~argv is supplied: if not supplied, run_main will call exit, and if supplied, it will raise exceptions. This could be surprising to users of the API, however.
@diml, what do you think about the last two paragraphs?
I'll be happy to submit a PR, considering your preference.
The text was updated successfully, but these errors were encountered:
I went with the first option in #84, because three functions need the exit behavior change, and it is easier to have three optional arguments, than duplicate all three functions and have six entry points.
This was just merged in #82. However, the new code is not quite correct:
parse_argv
raises exceptions instead of internally executingexit
.parse_argv
should be called with~current:(ref 0)
.Perhaps the right way to do this is to restore the former signature of
run_main
, and leave it as the function that callsexit
, and provide a new functionrun_main_with_argv
that will take anargv
argument and raise exceptions. I actually would preferrun_main_with_argv
not callexit
, because that allows linking a PPX directly into a test suite, which improves testing performance.Another option is to leave
run_main
with?argv
, but it will be have differently, depending on whether~argv
is supplied: if not supplied,run_main
will callexit
, and if supplied, it will raise exceptions. This could be surprising to users of the API, however.@diml, what do you think about the last two paragraphs?
I'll be happy to submit a PR, considering your preference.
The text was updated successfully, but these errors were encountered: