Re: [swift-evolution] Rekindling: "Extending declaration scope to condition for `repeat { } while ()"

2017-06-06 Thread Michael Savich via swift-evolution
hat is sorely needed elsewhere. > With time, I question whether this idea meets the necessarily high bar for > changing syntax; indeed if the motivation is to keep something from the outer > scope, it's trivial to make this happen with an outer `do`: > > ``` > do { > var i

[swift-evolution] Rekindling: "Extending declaration scope to condition for `repeat { } while ()"

2017-06-06 Thread Michael Savich via swift-evolution
It recently occurred to me how nice it would be to be if we could avoid declaring variables outside of loops that are only used inside them. I used google’s site specific search (is that the canon way to search swift-evo?) and only found one thread about this,

Re: [swift-evolution] Idea: "pure" keyword for function signatures

2017-05-26 Thread Michael Savich via swift-evolution
lt;https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20170213/032076.html> > > It would be important for those who wish to rekindle this discussion first to > review and summarize the preceding, and very technically illuminating, > discussions. > > > On Thu, May 25,

[swift-evolution] Idea: "pure" keyword for function signatures

2017-05-25 Thread Michael Savich via swift-evolution
Writing functions without side effects is generally considered to result in less error-prone code. In Swift today, if you want to segment your code into pure and impure functions, you just have to police yourself, which is a very un-Swifty thing to have to do. This problem is compounded when

[swift-evolution] InternalString class for easy String manipulation

2016-08-15 Thread Michael Savich via swift-evolution
Back in Swift 1.0, subscripting a String was easy, you could just use subscripting in a very Python like way. But now, things are a bit more complicated. I recognize why we need syntax like str.startIndex.advancedBy(x) but it has its downsides. Namely, it makes things hard on beginners. If one