[swift-evolution] [Proposal] Safer half-open range operator

Chris Lattner clattner at apple.com
Tue Apr 12 00:12:00 CDT 2016


> On Apr 11, 2016, at 12:30 PM, Dave Abrahams via swift-evolution <swift-evolution at swift.org> wrote:
> 
> 
> on Mon Apr 11 2016, Haravikk <swift-evolution at swift.org> wrote:
> 
>> I like the idea in theory, but the question is; is it really safer to return a
>> result that the developer may not have wanted, versus an error indicating that a
>> mistake may have been made? 
> 
> That's exactly the question.  We've considered doing it both ways.

Right.  There is a natural tension here between:

1) “fail fast” - so that an error is easily detected and reasoned about by the programmer, and
2) "blunder on” - hope that an error didn’t matter in practice, at the cost to making actual errors harder to diagnose.

-Chris


More information about the swift-evolution mailing list