Re: [swift-users] Exclamation mark's in swift parameter listings?

2017-01-18 Thread Slava Pestov via swift-users
Boxing usually refers to out-of-line allocation of values on the heap. For example, values of protocol type (as well as Any) will box their payload, depending on size. Slava > On Jan 18, 2017, at 10:53 PM, Rien wrote: > > Thanks Slava, > > Then my memory wasn’t that bad. This is indeed what

Re: [swift-users] Exclamation mark's in swift parameter listings?

2017-01-18 Thread Rien via swift-users
Thanks Slava, Then my memory wasn’t that bad. This is indeed what I was thinking of, but I should not have referred to it as ‘boxing’ ? Regards, Rien Site: http://balancingrock.nl Blog: http://swiftrien.blogspot.com Github: http://github.com/Swiftrien Project: http://swiftfire.nl > On 19 Ja

Re: [swift-users] Exclamation mark's in swift parameter listings?

2017-01-18 Thread Slava Pestov via swift-users
For what it’s worth, if T is a reference type or Unsafe*Pointer, then T and Optional have the same exact representation in memory. The compiler is smart enough to know that a non-optional pointer can never be NULL, so a NULL value of the underlying type can be used to unambiguously encode the ‘

Re: [swift-users] Exclamation mark's in swift parameter listings?

2017-01-10 Thread Rien via swift-users
I stand corrected. I do/did think that there is a difference in the way it handles pointers optionals and other optionals, but I now realise that even that could not be the case. So please ignore the last line in my previous post. The rest still stand ;-) Regards, Rien Site: http://balancingr

Re: [swift-users] Exclamation mark's in swift parameter listings?

2017-01-10 Thread Joe Groff via swift-users
> On Jan 9, 2017, at 11:19 PM, Rien via swift-users > wrote: > > It means that a call to that function with an optional will unwrap the > optional before it is used. > > That is quite neat when dealing with C-API’s because often you will receive a > pointer from a C-function which is optiona

Re: [swift-users] Exclamation mark's in swift parameter listings?

2017-01-09 Thread Rien via swift-users
It means that a call to that function with an optional will unwrap the optional before it is used. That is quite neat when dealing with C-API’s because often you will receive a pointer from a C-function which is optional to account for the fact that it can be NULL (= nil). By using a forced unw

Re: [swift-users] Exclamation mark's in swift parameter listings?

2017-01-09 Thread Daniel Dunbar via swift-users
It is an "implicitly unwrapped optional", or IOU. See: https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/TheBasics.html - Daniel > On Jan 9, 2017, at 4:23 PM, Ethin Probst via swift-users > wrote: > > Hello all, > I was wondering what an

[swift-users] Exclamation mark's in swift parameter listings?

2017-01-09 Thread Ethin Probst via swift-users
Hello all, I was wondering what an exclamation mark in a swift parameter listing means. For instance, I used Elements Oxidizer Live to translate some C# code into Swift. Reviewing it, I found the following (among others): @DllImport("ScriptHookV.dll") private static __extern func scriptRegister(_ m