Re: [swift-users] How to cast within #keyPath() ?

2017-07-25 Thread Manfred Schubert via swift-users
> Am 25.07.2017 um 18:31 schrieb Charles Srstka : > >> On Jul 25, 2017, at 11:26 AM, Manfred Schubert wrote: >> >> >>> Am 25.07.2017 um 18:21 schrieb Charles Srstka : >>> >>> #keyPath(MyView.property) should do it, I’d

Re: [swift-users] How to cast within #keyPath() ?

2017-07-25 Thread Manfred Schubert via swift-users
> Am 25.07.2017 um 18:21 schrieb Charles Srstka : > > #keyPath(MyView.property) should do it, I’d think. I think it wouldn't. It returns "property", but the path needs to be "view.property". Kind regards, Manfred ___

Re: [swift-users] What is up with names not being Strings any more in Swift 4?

2017-07-18 Thread Manfred Schubert via swift-users
> Am 18.07.2017 um 00:58 schrieb Greg Parker via swift-users > : > > >> On Jul 17, 2017, at 10:01 AM, Nevin Brackett-Rozinsky via swift-users >> wrote: >> >> Could / should these types be ExpressibleByStringLiteral? > > They should not. We are

[swift-users] What is up with names not being Strings any more in Swift 4?

2017-07-17 Thread Manfred Schubert via swift-users
Why are names no longer Strings any more in Swift 4? I am all for type safety, but now things like NSImage(named: "Icon.png") become NSImage(named: NSImage.Name(rawValue: "Icon.png")) and NSWindowController(windowNibName: "Window") becomes NSWindowController(windowNibName:

Re: [swift-users] What is "binding" memory?

2016-11-03 Thread Manfred Schubert via swift-users
Am 03.11.2016 um 15:41 schrieb Rien : > > Ah, but that is not the case. > > It is important to differentiate between the “gateway” to the memory and the > memory area itself. > Different programming languages/compilers have different approaches, but I > believe that

Re: [swift-users] What is "binding" memory?

2016-11-03 Thread Manfred Schubert via swift-users
> Am 02.11.2016 um 18:37 schrieb Rien : > >>> >>> var rawPtr = UnsafeMutableRawPointer.allocate(bytes: 2, alignedTo: 0) >>> >>> var widePtr = rawPtr.bindMemory(to: Int16.self, capacity: 1) >>> >>> widePtr.pointee = 32 >>> >>> var narrowPtr = rawPtr.bindMemory(to:

Re: [swift-users] What is "binding" memory?

2016-11-02 Thread Manfred Schubert via swift-users
Am 01.11.2016 um 21:40 schrieb Andrew Trick : > > I’m not sure I like the “prepares the memory” language myself. Binding memory > communicates to the compiler that the memory locations are safe for typed > access. Nothing happens at runtime--until someone writes a type safety

[swift-users] What is "binding" memory?

2016-11-01 Thread Manfred Schubert via swift-users
The "UnsafeRawPointer Migration" guide talks about "binding memory to a type“ as if that was a well known term. I have never heard of it yet though, and googling it returns no relevant results. I do not understand what binding memory is supposed to do. The migration guide says "Binding