Re: testing with a "warn"

2016-04-30 Thread Siavash
Wall <la...@wall.org> Date: > 30/04/2016 06:45 (GMT+08:00) To: Brandon Allbery <allber...@gmail.com> Cc: > Timo Paulssen <t...@wakelift.de>, perl6-users <perl6-users@perl.org> Subject: > Re: testing with a "warn" > On Fri, Apr 29, 2016 at 03:50:2

Re: testing with a "warn"

2016-04-29 Thread rnhainsworth
: Larry Wall <la...@wall.org> Date: 30/04/2016 06:45 (GMT+08:00) To: Brandon Allbery <allber...@gmail.com> Cc: Timo Paulssen <t...@wakelift.de>, perl6-users <perl6-users@perl.org> Subject: Re: testing with a "warn" On Fri, Apr 29, 2016 at 03:50:21PM -0400, Brand

Re: testing with a "warn"

2016-04-29 Thread Brandon Allbery
On Fri, Apr 29, 2016 at 6:45 PM, Larry Wall wrote: > If you need to produce actual warnings in hot code, something's wrong > with your design. (If you just want to print to STDERR, you can use > 'note' instead.) > The latter's more what I was getting at, yes. -- brandon s

Re: testing with a "warn"

2016-04-29 Thread Brandon Allbery
On Fri, Apr 29, 2016 at 3:47 PM, Brandon Allbery wrote: > Oh, they are resumable exceptions? Useful but rather high cost I'd think. > (Granting that perl6 isn't one of those languages that think exceptions > should be normal control flow. But anyone who decides it should be

Re: testing with a "warn"

2016-04-29 Thread Timo Paulssen
I didn't actually read the other mail in this thread yet, but you can catch a control exception (like warn uses) with a CONTROL block. Don't forget to .resume the exception unless you want it to break out of your code, too. Hope to help! - Timo

Re: testing with a "warn"

2016-04-29 Thread Brandon Allbery
On Fri, Apr 29, 2016 at 1:25 AM, Richard Hainsworth wrote: > throws-like { abc('excess') }, Exception, 'got the exception', message => > / excess recursion /; I'm confused as to why you would expect this to work. The point of warn is it is *not* an exception; an exception by

testing with a "warn"

2016-04-29 Thread Richard Hainsworth
I have a condition that uses warn something like (its just an illustration) sub abc { ... if $iterations > 150 { $iterations = 150; warn 'excess recursion, clamping at 150'; } In my test suite I tried throws-like { abc('excess') }, Exception, 'got the exception', message =>