masak / alma

ALgoloid with MAcros -- a language with Algol-family syntax where macros take center stage
Artistic License 2.0
139 stars 15 forks source link

Handling of MAIN over-catches X::ParameterMismatch exceptions #575

Open masak opened 2 years ago

masak commented 2 years ago

I remember noticing this long ago, but it seems I never reported it as an issue.

The way the MAIN function is handled in the runtime means we catch and handle X::ParameterMismatch exceptions that get thrown as part of MAIN parameter handling. But... we also wrongly catch and handle other thrown X::ParameterMismatch exceptions that get thrown as part of running MAIN. This is wrong.

The solution seems involve separating out parameter binding from actually making the call. So that we can put the CATCH on the parameter binding only.