Re: [swift-users] ADMINISTRATORS: Mail loop on swift-corelibs-commits

2015-12-30 Thread Kenny Leung via swift-users
Is anybody else seeing this with swift-corelibs-commits or is it just me? -Kenny > On Dec 29, 2015, at 9:32 AM, Kenny Leung via swift-users > <swift-users@swift.org> wrote: > > Hi All. > > swift-corelibs-commits seems to be stuck getting repeats of commit message

[swift-users] Problems - hard to describe

2016-06-24 Thread Kenny Leung via swift-users
Hi All. My problems are so weird that I don’t even know what to put in the subject line. I’m using the latest Swift 3 snapshot, and I’m trying to write a bridge from [String] to (const char * const *) Here’s my code: public struct ArrayBridge { let originals

Re: [swift-users] Problems - hard to describe

2016-06-24 Thread Kenny Leung via swift-users
Hi All. I fixed my Problems. It turns out I had the declaration typed wrong. CType should have been CChar instead of [CChar]. The working version is this: public struct ArrayBridge { let originals :[SwiftType] let translated :[[CType]] let pointers

Re: [swift-users] Problems - hard to describe

2016-06-24 Thread Kenny Leung via swift-users
Filed as SR-1900 -Kenny ___ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users

Re: [swift-users] Specifying A Dynamic Type In Swift Generics

2016-07-05 Thread Kenny Leung via swift-users
So, restating the question: You want to have a method on a class such that it will return an object which is genericised with that class. Like: class A { func createB() -> B { } } So that if you have C which is a subclass of A, calling createB() would return B, and not B Is that

[swift-users] TWISt-shout Newsletter 2017-02-06

2017-02-06 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-01-31 to 2017-02-05 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-02-06.md Enjoy! -Kenny

Re: [swift-users] TWISt-shout Newsletter 2017-01-30

2017-01-30 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-01-23 to 2017-01-29 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-01-30.md Enjoy! -Kenny

[swift-users] TWISt-shout Newsletter 2017-02-20

2017-02-19 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-02-13 to 2017-02-19 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-02-20.md Enjoy! -Kenny ___ swift-users mailing list swift-users@swift.org

[swift-users] TWISt-shout Newsletter 2017-02-13

2017-02-12 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-02-06 to 2017-02-13 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-02-13.md Enjoy! -Kenny

Re: [swift-users] TWISt-shout Newsletter 2017-02-13

2017-02-13 Thread Kenny Leung via swift-users
017/TWISt-shout-2017-02-13.md> Thanks to Sebastian Hagedorn. -Kenny > On Feb 12, 2017, at 10:33 PM, Kenny Leung via swift-users > <swift-users@swift.org> wrote: > > Hi All. > > Here is your TWISt-shout Newsletter for the week of 2017-02-06 to 2017-02-13 > >

[swift-users] TWISt-shout Newsletter 2017-01-16

2017-01-16 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-01-09 to 2017-01-015 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-01-16.md Enjoy! -Kenny ___ swift-users mailing list swift-users@swift.org

Re: [swift-users] Bridging [String] to const char * const *

2016-08-18 Thread Kenny Leung via swift-users
on't have to worry about lifetimes. > > Jordan > >> On Aug 18, 2016, at 13:04, Kenny Leung via swift-users >> <swift-users@swift.org> wrote: >> >> Hi All. >> >> When interfacing with C, Swift does some magic to auto-convert Swift strings >

[swift-users] TWISt-shout Newsletter 2017-02-27

2017-02-26 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-02-20 to 2017-02-26 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-02-27.md Enjoy! -Kenny ___ swift-users mailing list swift-users@swift.org

Re: [swift-users] Working with const char** with Swift 3

2016-09-19 Thread Kenny Leung via swift-users
Hi Ron. Not sure if you just want to have an array of Strings, and are working entirely in Swift. If so, you can just do func haveSwiftFun(data :[String]?) { for string in data { print(string) } } If you’re looking to interface Swift with a C function that takes const char *

[swift-users] Bridging [String] to const char * const *

2016-08-18 Thread Kenny Leung via swift-users
Hi All. When interfacing with C, Swift does some magic to auto-convert Swift strings to char *. This is great, but passing an array of string pointers gets much more involved. The type translates to UnsafePointer in Swift. So I originally tried to get pointers to the individual

Re: [swift-users] How self automatically becomes Self type if the function's return type is Self?

2016-08-28 Thread Kenny Leung via swift-users
There is no magic happening here. Rather, I think it’s a misunderstanding of what -> Self means. Self is a placeholder for “the current type”, just like self is a placeholder for “the current instance”. So when you declare -> Self, the correct thing to do is an instance of Self, which is self.

Re: [swift-users] Subclass instance passed to closure expecting parent class “cannot convert value of type to expected argument type”

2016-09-28 Thread Kenny Leung via swift-users
Could it be because ModelListResponse is Generalized while APIResponse is not? -Kenny > On Sep 28, 2016, at 5:43 PM, Eric Conner via swift-users > wrote: > > Hello all! > > I hope it's not frowned upon to repost a question here from Stack Overflow, > but I have not

Re: [swift-users] Bool to Int

2016-11-21 Thread Kenny Leung via swift-users
This is so confusing. "Literals are untyped", but there’s a “BooleanLiteral”, which is obviously of type Boolean. -Kenny > On Nov 21, 2016, at 2:49 AM, Adrian Zubarev via swift-users > wrote: > > In general this is a correct behaviour, because literals in Swift are >

Re: [swift-users] hello, first time poster and accelerate question

2016-11-21 Thread Kenny Leung via swift-users
If only you could write this directly in Swift and have it use accelerate… -Kenny > On Nov 18, 2016, at 8:07 PM, Jacob Bandes-Storch via swift-users > wrote: > > I must have forgotten how matrices work—I think it's actually this direction. > And I also lost an m :-) >

Re: [swift-users] Bool to Int

2016-11-22 Thread Kenny Leung via swift-users
Hi Marc. My old mechanical engineering prof used to say, “C is easy if you know assembler”. The fact that such a simple construct does not work and requires such a long explanation - which may still not be understood by a newbie - is a problem that should be addressed. Even this explanation

Re: [swift-users] Compiler should issue a warning when a subclass implementation with default values matches a parent implementation without them

2017-01-05 Thread Kenny Leung via swift-users
Hi All. I think this is a case of ambiguity that the compiler is not catching at the call site. Consider this example: private class DefaultValues { // If this method exists, it compiles and it called. // If this method does not exist, the code in the test says, "Ambiguous use of

[swift-users] TWISt-shout Newsletter 2017-01-09

2017-01-09 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-01-02 to 2017-01-08 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-01-09.md Enjoy! -Kenny ___ swift-users mailing list swift-users@swift.org

[swift-users] TWISt-shout Newsletter 2017-01-02

2017-01-02 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2016-12-26 to 2017-01-01 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-01-02.md Enjoy! -Kenny ___ swift-users mailing list swift-users@swift.org

[swift-users] TWISt-shout Newsletter 2016-12-19

2016-12-19 Thread Kenny Leung via swift-users
Here is your TWISt-shout Newsletter for the week of 2016-12-12 to 2016-12-18 https://github.com/pepperdog/TWISt-shout/blob/master/2016/TWISt-shout-2016-12-19.md Enjoy! -Kenny

[swift-users] TWISt-shout Newsletter 2016-12-26

2016-12-26 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2016-12-19 to 2016-12-25 https://github.com/pepperdog/TWISt-shout/blob/master/2016/TWISt-shout-2016-12-26.md Enjoy! -Kenny ___ swift-users mailing list swift-users@swift.org

[swift-users] TWISt-shout Newsletter 2017-03-20

2017-03-20 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-03-13 to 2017-03-19 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-03-20.md Enjoy! -Kenny ___ swift-users mailing list swift-users@swift.org

[swift-users] TWISt-shout Newsletter 2017-04-10

2017-04-09 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-04-03 to 2017-04-09 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-04-10.md Enjoy! -Kenny

[swift-users] TWISt-shout Newsletter 2017-04-17

2017-04-17 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-04-10 to 2017-04-16 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-04-17.md Enjoy! -Kenny

[swift-users] TWISt-shout Newsletter 2017-04-24

2017-04-23 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-04-17 to 2017-04-23 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-04-24.md Enjoy! -Kenny

[swift-users] TWISt-shout Newsletter 2017-03-06

2017-03-05 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-02-27 to 2017-03-05 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-03-06.md Enjoy! -Kenny ___ swift-users mailing list swift-users@swift.org

Re: [swift-users] Ugliness bridging Swift String to char *

2017-03-05 Thread Kenny Leung via swift-users
Follow-up on this: The StaticString solution doesn’t work: let separator: StaticString = “|” opt.fieldSep = UnsafeMutablePointer(mutating: separator.utf8start) … because utf8start returns UnsafePointer, and fieldSep is actually UnsafeMutablePointer. There doesn’t seem to be any way to convert

[swift-users] Ugliness bridging Swift String to char *

2017-03-01 Thread Kenny Leung via swift-users
Hi All. Swift automatically bridges String to char * when calling C functions. For instance, strlen gets translated as: public func strlen(_ __s: UnsafePointer!) -> UInt I can call it from Swift like this: strlen("|") I’m But, I’m working with a C struct containing a char *:

[swift-users] TWISt-shout Newsletter 2017-04-03

2017-04-02 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-03-27 to 2017-04-02 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-04-03.md Enjoy! -Kenny

[swift-users] TWISt-shout Newsletter 2017-08-14

2017-08-14 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-08-07 to 2017-08-13 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-08-14.md Enjoy! -Kenny

[swift-users] TWISt-shout Newsletter 2017-07-10

2017-07-09 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-07-03 to 2017-07-10 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-07-10.md Enjoy! -Kenny

[swift-users] TWISt-shout Newsletter 2017-07-17

2017-07-16 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-07-10 to 2017-07-16 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-07-17.md Enjoy! -Kenny

[swift-users] TWISt-shout Newsletter 2017-07-24

2017-07-25 Thread Kenny Leung via swift-users
Comic-Con Edition! Hi All. Here is your TWISt-shout Newsletter for the week of 2017-07-17 to 2017-07-23 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-07-24.md Enjoy! -Kenny

[swift-users] TWISt-shout Newsletter 2017-07-03

2017-07-02 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-06-25 to 2017-07-02 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-07-03.md Enjoy! -Kenny ___ swift-users mailing list swift-users@swift.org

[swift-users] TWISt-shout Newsletter 2017-07-31

2017-07-30 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-07-24 to 2017-07-30 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-07-31.md Enjoy! -Kenny

[swift-users] TWISt-shout Newsletter 2017-08-07

2017-08-06 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-07-31 to 2017-08-06 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-08-07.md Enjoy! -Kenny

[swift-users] TWISt-shout Newsletter 2017-08-14

2017-08-20 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-08-14 to 2017-08-20 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-08-21.md Enjoy! -Kenny

[swift-users] TWISt-shout Newsletter 2017-05-15

2017-05-15 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-05-08 to 2017-05-14 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-05-15.md Enjoy! -Kenny

[swift-users] TWISt-shout Newsletter 2017-06-26

2017-06-25 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-06-19 to 2017-06-25 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-06-26.md Enjoy! -Kenny

[swift-users] TWISt-shout Newsletter 2017-06-05

2017-06-04 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-05-29 to 2017-06-04 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-06-05.md Enjoy! -Kenny

[swift-users] TWISt-shout Newsletter 2017-06-12

2017-06-11 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-06-05 to 2017-06-11 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-06-12.md Enjoy! -Kenny

[swift-users] TWISt-shout Newsletter 2017-06-19

2017-06-18 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-06-12 to 2017-06-18 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-06-19.md Enjoy! -Kenny

[swift-users] TWISt-shout Newsletter 2017-05-08

2017-05-07 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-05-01 to 2017-05-07 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-05-08.md Enjoy! -Kenny

[swift-users] TWISt-shout Newsletter 2017-09-18

2017-09-17 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-09-11 to 2017-09-17 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-09-18.md Enjoy! -Kenny

[swift-users] TWISt-shout Newsletter 2017-10-16

2017-10-15 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-10-09 to 2017-10-16 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-10-16.md Enjoy! -Kenny

Re: [swift-users] Still can't derive from a generic class

2017-08-30 Thread Kenny Leung via swift-users
Just curious, and because I have a distinct lack of imagination: can you share a concrete case of this pattern? Thanks! -Kenny > On Aug 29, 2017, at 10:04 AM, Joanna Carter via swift-users > wrote: > > Hi > > I would have hoped by now that it should be possible to

Re: [swift-users] Still can't derive from a generic class

2017-08-30 Thread Kenny Leung via swift-users
Just curious, and because I have a distinct lack of imagination: can you share a concrete case of this pattern? Thanks! -Kenny > On Aug 29, 2017, at 10:04 AM, Joanna Carter via swift-users > wrote: > > Hi > > I would have hoped by now that it should be possible to

[swift-users] TWISt-shout Newsletter 2017-09-11

2017-09-10 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-09-04 to 2017-09-10 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-09-11.md Enjoy! -Kenny

[swift-users] TWISt-shout Newsletter 2017-09-25

2017-09-24 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-09-18 to 2017-09-24 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-09-25.md Enjoy! -Kenny

[swift-users] Initialization Catch-22?

2017-09-25 Thread Kenny Leung via swift-users
Hi All. 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 to pass a block to the function that creates the AudioQueue. I get the

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

2017-09-25 Thread Kenny Leung via swift-users
gt; }() > } > > Thanks and regards, > Muthu > > >> On 26 Sep 2017, at 9:12 AM, Kenny Leung via swift-users >> <swift-users@swift.org <mailto:swift-users@swift.org>> wrote: >> >> Hi All. >> >> I’m trying to implement the AudioQueu

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

2017-09-27 Thread Kenny Leung via swift-users
this project whether I really have everything I need for the callback block. I may have to resort to one of the other measures you all have suggested. Thanks again! -Kenny > On Sep 26, 2017, at 12:40 AM, Greg Parker <gpar...@apple.com> wrote: > >> >> On Sep 25, 2017, at

[swift-users] TWISt-shout Newsletter 2017-10-02

2017-10-01 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-09-18 to 2017-09-24 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-10-02.md Enjoy! -Kenny

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

2017-09-26 Thread Kenny Leung via swift-users
ailed queue before overwriting on last line of `init`. > > On Tue, 26 Sep 2017 at 11:39 am, Kenny Leung via swift-users > <swift-users@swift.org <mailto:swift-users@swift.org>> wrote: > Hi Muthu. > > Thanks for the suggestion. > > I don’t want to do that because f

[swift-users] TWISt-shout Newsletter 2017-08-28

2017-08-27 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-08-21 to 2017-08-26 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-08-28.md Enjoy! -Kenny

[swift-users] TWISt-shout Newsletter 2017-09-04

2017-09-03 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-08-29 to 2017-09-03 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-09-04.md Enjoy! -Kenny

[swift-users] TWISt-shout Newsletter 2017-10-09

2017-10-08 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-10-02 to 2017-10-08 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-10-09.md Enjoy! -Kenny

[swift-users] TWISt-shout Newsletter 2017-11-13

2017-11-13 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-11-06 to 2017-11-12 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-11-13.md Enjoy! -Kenny

[swift-users] TWISt-shout Newsletter 2017-11-27

2017-11-26 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-11-20 to 2017-11-26 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-11-27.md Enjoy! -Kenny

[swift-users] TWISt-shout Newsletter 2017-12-18

2017-12-17 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-12-11 to 2017-12-17 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-12-18.md Enjoy! -Kenny

[swift-users] TWISt-shout Newsletter 2017-11-20

2017-11-19 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-11-13 to 2017-11-19 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-11-20.md Enjoy! -Kenny

[swift-users] TWISt-shout Newsletter 2017-11-06

2017-11-05 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-10-30 to 2017-11-05 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-11-06.md Enjoy! -Kenny

[swift-users] TWISt-shout Newsletter 2017-12-04

2017-12-03 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-11-27 to 2017-12-03 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-12-04.md Enjoy! -Kenny

[swift-users] TWISt-shout Newsletter 2017-12-11

2017-12-10 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-11-04 to 2017-12-10 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-12-11.md Enjoy! -Kenny

[swift-users] TWISt-shout Newsletter 2017-10-30

2017-10-29 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-10-23 to 2017-10-29 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-10-30.md Enjoy! -Kenny

[swift-users] TWISt-shout Newsletter 2017-10-23

2017-10-22 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-10-16 to 2017-10-22 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-10-23.md Enjoy! -Kenny

Re: [swift-users] Rethrows issue

2017-12-31 Thread Kenny Leung via swift-users
How about this? func withPredicateErrors( _ predicate: @escaping (Element) throws -> Bool, do body: ((Element) -> Bool) -> Return ) rethrows -> Return { var caught: Error? var element: Element? let value = body { elem in element = elem

[swift-users] TWISt-shout Newsletter New Year's Day 2018

2017-12-31 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-12-25 to 2017-12-31 https://github.com/pepperdog/TWISt-shout/blob/master/2018/TWISt-shout-2018-01-01.md Happy New Year! Enjoy! -Kenny

Re: [swift-users] Can't make an escaping closure argument optional?

2018-01-05 Thread Kenny Leung via swift-users
foo() { > noesc { > print(owner) // compiles > } > esc { > print(owner) // error: requires explicit 'self.'… > } > Optional<()->()>.some { > print(owner) // error: requires explicit 'self.'… > } > } > > >> On Ja

[swift-users] Can't make an escaping closure argument optional?

2018-01-05 Thread Kenny Leung via swift-users
Hi All. It seems that if you have an escaping closure argument, you can’t make it optional. Am I right? init ( owner:AnyObject, handler:@escaping (HXObserverNotification)->Void ) { self.owner = owner self.handler = handler } You could try this:

Re: [swift-users] Can't make an escaping closure argument optional?

2018-01-05 Thread Kenny Leung via swift-users
against Swift related this and I don’t know their current state. > > If after removing @escaping things still fail to compile please post a code > example. > > -Shawn > On Fri, Jan 5, 2018 at 1:17 PM Kenny Leung via swift-users > <swift-users@swift.org <mailto:swi

[swift-users] TWISt-shout Newsletter 2017-12-25

2017-12-24 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2017-12-18 to 2017-12-24 https://github.com/pepperdog/TWISt-shout/blob/master/2017/TWISt-shout-2017-12-25.md Enjoy! -Kenny

[swift-users] TWISt-shout Newsletter 2018-01-15

2018-01-15 Thread Kenny Leung via swift-users
Hi All. Here is your TWISt-shout Newsletter for the week of 2018-01-08 to 2018-01-14 https://github.com/pepperdog/TWISt-shout/blob/master/2018/TWISt-shout-2018-01-15.md Enjoy! -Kenny

[swift-users] KeyPaths and PartialKeyPaths - when can you leave out the class?

2018-01-11 Thread Kenny Leung via swift-users
Hi All. I’d like to be lazy and leave out the classname on a key path whenever possible. I thought that if PartialKeyPath was specified as the argument type, that meant the compiler should be able to figure out what the class is, but this does not seem to be the case. Here’s an example that

Re: [swift-users] KeyPaths and PartialKeyPaths - when can you leave out the class?

2018-01-11 Thread Kenny Leung via swift-users
feature request. Please file at bugs.swift.org > <http://bugs.swift.org/>. > > Jordan > > >> On Jan 11, 2018, at 14:41, Kenny Leung via swift-users >> <swift-users@swift.org <mailto:swift-users@swift.org>> wrote: >> >> Hi All. >>

Re: [swift-users] Generics question - can you handle both optional and non-optional args with the same function?

2018-01-11 Thread Kenny Leung via swift-users
c f2t(_ x: XType?) throws -> RetType > func f3t(_ x: XType?) throws -> RetType? > > Hope this helps, > Hooman > >> On Jan 11, 2018, at 5:55 PM, Kenny Leung via swift-users >> <swift-users@swift.org <mailto:swift-users@swift.org>> wrote: >> >>

[swift-users] Generics question - can you handle both optional and non-optional args with the same function?

2018-01-11 Thread Kenny Leung via swift-users
Hi All. I’m trying to write a utility method that is kind of the opposite of “x ?? y”, which means “x != nil ? x : y”. I want “x != nil ? f(x) : nil” This is not difficult to write, but if you have "f(x)->z" and "g(x)->z?", I seem to need two versions of the function in order to handle it. Is