Re: [swift-users] Swift 4 "Cannot use mutating member on immutable value: 'self' is immutable"

2017-09-18 Thread Elia Cereda via swift-users
NSMutableArray does provide O(1) insertion and removal from the start and the end of the array (http://ciechanowski.me/blog/2014/03/05/exposing-nsmutablearray/). I think the reason Swift doesn't use this design is because it stores the data in a contiguous block of memory. Elia Cereda > Il

Re: [swift-users] noob question about modules

2017-09-18 Thread blaster_in_black via swift-users
For the record, I will paste here the answer I have received on StackOverflow. It adds some useful tips to the info provided by Alex. In short, Swift modules are somehow equivalent to Java packages, and Swift frameworks to Java .jars (if we don't get too formal); Swift (sub)modules can be visibl

Re: [swift-users] Swift 4 "Cannot use mutating member on immutable value: 'self' is immutable"

2017-09-18 Thread Geordie Jay via swift-users
It seems to me that some of these concerns could be fixed by returning ArraySlice instead of Array on popFirst(). Then you’d have similar performance expectations and explicit copying like with String / Substring. Geordie Elia Cereda via swift-users schrieb am Mo. 18. Sep. 2017 um 11:12: > NSM

Re: [swift-users] Swift 4 "Cannot use mutating member on immutable value: 'self' is immutable"

2017-09-18 Thread Vladimir.S via swift-users
On 17.09.2017 13:25, Quinn "The Eskimo!" via swift-users wrote: On 15 Sep 2017, at 21:35, Vladimir.S via swift-users wrote: … for me it is very strange decision to disallow a method because it is 'expensive'. That’s pretty normal for Swift standard library protocols, which define not jus

Re: [swift-users] Swift 4 "Cannot use mutating member on immutable value: 'self' is immutable"

2017-09-18 Thread Quinn "The Eskimo!" via swift-users
On 18 Sep 2017, at 13:52, Vladimir.S wrote: > Can't understand/accept this, sorry. You seem to be very invested in how Swift /should/ work, rather than how it /does/ work. I’m sympathetic with that position but it’s really a topic of conversation for swift-evolution rather than swift-users.