SE-0199: Adding toggle method to Bool

What I really liked about the review decision was that it enumerated five bases for accepting this proposal. A less thoughtful pitch of the same idea would have failed very quickly, but thanks to the detailed discussion here and very well-written feedback, we've got not only a new method, but also some new ways to evaluate future additions to the standard library. Specifically, rephrasing the feedback into question form:

  • Does the proposed addition solve a need that is common across multiple different problem domains?
  • Does it significantly improve readability?
  • Is it important to have a consistent way of doing this across all Swift codebases?
  • Is there a correctness risk to existing alternatives that the new addition would avoid?
  • Can the new addition be made more efficient than existing alternatives?

I do not imagine that this is an easy standard to meet for arbitrary additions to the standard library.

6 Likes