Parrot didn't throw exceptions on param or result count mismatch until
now, and still doesn't. [1]
But, I have invented 2 more error flag bits [2], which can enable
stricter argument checking and the exception is catchable in the
subroutine itself now:
.include "errors.pasm"
errorson .PARROT_ERRORS_PARAM_COUNT_FLAG
foo(1, 2)
...
.sub foo
push_eh handler
get_params '(0)', $P0 # no .params yet - sorry
handler:
.local pmc e
.local string m
.get_results (e, m)
printerr m
exit 1
A few tests are in t/op/calling.t
I hope this is useful.
leo
[1] all PGE and PGE-based stuff is failing, when both are turned on
[1] please reconfigure, perldoc ops/core.ops /errorson