Hi, Stephen Weeks asked for clarification on #perl6 on how to implement $!, I didn't find the answer for most the issues.
In particular: * S04 states that .defined and .true mark the Exception object as handled. But what do those methods return? alway true (since $! contains undef anyway if there was no exception)? Or do they proxy their payload (ie try { die $object }; $!.true returns the same as $object.true)? * What about the other methods? t/spec/S02-magicals/dollar_bang.t assumes that $! stringifies like its payload. Is that correct? * Another test (forgot which) actually assumes that $! has the type of the payload, so that try { die 1; }; $! ~~ Int would return True. This seems unlikely to me, but I think I should ask anyway: is that assumption correct? * dollar_bang.t also has this test: : try { : try { : die 'qwerty'; : } : ok ~($!) ~~ /qwerty/, 'die sets $! properly'; : die; # use the default argument : } : #?rakudo todo 'stringification of $!' : ok ~($!) ~~ /qwerty/, 'die without argument uses $! properly'; that seems to assume that an empty 'die;' re-uses the previous $! value - is that correct? * S04 also says "Because the contextual variable C<$!> contains all exceptions collected in the current lexical scope[...]" What does that mean in terms of implementation? Does $! contain a list of all assembled exceptions, and item context always gives access to the last one? Is there a user visible way to access these exceptions? Cheers, Moritz