masak / alma

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

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

Open masak opened 1 year ago

masak commented 1 year 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.