There's a little problem with it. You see, right now this works: exit "1"
So we simply cannot force it to do something else with Strs because that can break existing (perfectly valid) code. We can go through a long deprecation cycle but it's not worth it (IMO). But it may be possible to catch X::Str::Numeric exception and print better message for this situation… ¯\_(ツ)_/¯ On 2017-08-10 02:09:30, szab...@gmail.com wrote: > In Python one can pass a string to the exit() function that will be > displayed and the program exited. > > > In Perl 6 I get: > > $ perl6 > To exit type 'exit' or '^D' > > exit("hello") > Cannot convert string to number: base-10 number must begin with valid > digits or '.' in '⏏hello' (indicated by ⏏) > in block <unit> at <unknown file> line 1 > > 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? > > Better yet, could exit accept a string?