Return value of try

2010-11-15 Thread Aaron Sherman
I was listening to the recent IO conversation on p6c, and decided to look at IO.pm in rakudo. I immediately saw a bit of code that worried me: try { ?$!PIO.close() } $! ?? fail($!) !! Bool::True Why is that so cumbersome? That seems like one of the most

Re: Return value of try

2010-11-15 Thread Ruud H.G. van Tol
On 2010-11-15 23:46, Aaron Sherman wrote: try { ?$!PIO.close() } $! ?? fail($!) !! Bool::True Probably try{} can be made to return a True when there was no exception? try { ... 1; } or fail( ... ); try { ...