On Thu Apr 05 14:56:03 2012, pmichaud wrote: > On Thu, Apr 05, 2012 at 01:46:53PM -0700, Carl Mäsak wrote: > > <moritz> r: say ~(1, 2, 6 ... *)[10] > > <p6eval> rakudo 4373f0: OUTPUT«» > > <moritz> eeks > > <moritz> no, that particular thing isn't in RT > > * masak submits rakudobug > > For the moment, I'm going to argue Rakudo's behavior here as > "correct", or at least consistent with the spec. > > The sequence (1, 2, 6 ... *) produces a list with > four elements: 1, 2, 6, and a Failure object containing > "unable to deduce sequence". This list is then asked for > its tenth element, which is Nil (because it's beyond the end > of the list), which is what is stringified and printed. > > Since the Failure object is never used, its associated > exception is never thrown.
I'm not sure if I should have been asking this on IRC, or on the language list instead, but, here goes... I don't know how things map consistently for the general case, but from that example as a user I would be surprised and disappointed that the "unable to deduce sequence" isn't reported at compile time, as a compile time error. (Independent of the bug as reported, that element 10 is Nil). In that, as a programmer I would prefer to be told about errors at compile time, rather than having to rely on good coverage of my test suite to spot these errors before code gets into production. And as no test suite is perfect (and not everywhere has tests), there's going to be a chance that bad code does get into production, and goes wrong at the most awkward 2am it can find. Nicholas Clark