Re: [swift-users] UnsafeMutableRawPointer to UnsafeMutablePointer: EXC_BAD_ACCESS on pointee

2017-09-26 Thread nyg nyg via swift-users
Thanks Braden for pointing out that toOpaque() was just a cast of c to UnsafeMutableRawPointer. And thanks Guillaume too, I now understand why my code doesn't and can't work. All this messing around has confused me greatly and I lost track of what I originally wanted to do :). At first, I wanted

Re: [swift-users] Initialization Catch-22?

2017-09-26 Thread Howard Lovatt via swift-users
I know were you are coming from, but: 1. In other languages it would be the equivalent of an force unwrapped optional and you could get a NullPointerException (or worse - core dump). Using a force unwrapped optional just levels the playing field! 2. You could make it private(set) which would

Re: [swift-users] Initialization Catch-22?

2017-09-26 Thread Greg Parker via swift-users
> On Sep 25, 2017, at 6:12 PM, Kenny Leung via swift-users > wrote: > > I’m trying to implement the AudioQueue example from Apple in Swift, and keep > it as Swifty as I can. I’ve run into a problem where I have a let ivar for > the AudioQueue, but the only way to initialize that let ivar is t

Re: [swift-users] range(of:options:range:locale:) with partial ranges

2017-09-26 Thread Martin R via swift-users
> On 22. Sep 2017, at 23:55, Ben Cohen wrote: > > In order to be able to use pos… this function would need to be converted from > it’s current signature (that takes a concrete Range) to be generic over any > RangeExpression.In this case of this method, the range is optional – and in > case of