[swift-users] KeyedDecodingContainerProtocol decode methods non-mutating?

2017-12-28 Thread Ingo Maier via swift-users
Can anybody tell why the decode methods in UnkeyedDecodingContainer are marked mutating but those in KeyedDecodingContainerProtocol and SingleValueDecodingContainer are not? Is it a simple oversight or is there a reason for this? It seems to me that all of them should be mutating. Thanks, Ingo ___

Re: [swift-users] C interop: passing null pointers to unwrapped unsafe pointers

2016-10-08 Thread Ingo Maier via swift-users
Oh thanks, I fundamentally misunderstood how unwrapped optionals work. On Fri, Oct 7, 2016 at 6:25 PM, Joe Groff wrote: > >> On Oct 7, 2016, at 7:02 AM, Ingo Maier via swift-users >> wrote: >> >> Is there a way in Swift 3 to pass a null pointer to a C function

[swift-users] C interop: passing null pointers to unwrapped unsafe pointers

2016-10-07 Thread Ingo Maier via swift-users
Is there a way in Swift 3 to pass a null pointer to a C function that takes an implicitly unwrapped unsafe pointer? I understand that pointer parameters in C that don't specify nullability are mapped to implicitly unwrapped pointers in Swift 3. Since it's not uncommon for existing unannotated C API

Re: [swift-users] Optional chaining and String properties

2016-08-01 Thread Ingo Maier via swift-users
Yes, parenthesized expressions are primary expressions, which in turn are all postfix expressions as specified by the first grammar rule for postfix expressions and also the note you mentioned. I do think that swiftc's behavior is the most intuitive. I just think the spec needs to be clarified in t

Re: [swift-users] Optional chaining and String properties

2016-08-01 Thread Ingo Maier via swift-users
If you are looking for the actual rules, they are defined in the language reference, in the section on optional chaining expressions [1]. It states that if you have an optional chaining expression of the form `expression?` then "If the value of the optional-chaining expression is nil, all of the o