Would it be possible to special case when someone passes a string to
exit and give a better error message telling how to write that?


Maybe the error message should indicate what types are allowed.

Better yet, could exit accept a string?

That would be equivalent to `print("hello");exit(0)`.
Very little added value IMHO, but source of potential confusion: How will `exit($x)` use the content of `$x`, as a return code or as something to print? You have to check whether `$x` is an integer or not - and what about floating-point numbers? It could be converted to string or to int, and at least some programmers will expect the opposite of what Perl6 is doing.

TL;DR it shouldn't accept a string, that would be worse than throwing an error.
(IMHO etc.)

Reply via email to