Swift weekly 2018/01/02

3f7d9611fc919c98512b779cde637dfc?s=47 Johnlin
January 02, 2018

Swift weekly 2018/01/02

3f7d9611fc919c98512b779cde637dfc?s=128

Johnlin

January 02, 2018
Tweet

Transcript

  1. Swift पใ 2018/01/02 John Lin @johnlinvc

  2. From the core • Swift ࿦ஃ

  3. Swift ࿦ஃ • https://forums.swift.org/ • ༬ܭ Ұ݄ॳ။ਖ਼ࣜ⬏༻

  4. Evolution • [SE-0187] Ճೖ Sequence.filterMap(_:) Sequence.compactMap(_:)

  5. [SE-0187] Ճೖ Sequence.compactMap(_:) • ݱࡏSwift ༗ࡾछ flatMap • ୈҰछੋ࠷ৗݟతɼᩋၷ૚త Sequence

    Ꮣ Ұ૚
 let fm1 = [[1,2], [2,3]].flatMap { return $0 } fm1 //[1,2,2,3] • ୈೋछੋሣ Optional ཫ໘తᆴ၏ࣄ
 let opt : Int? = 1 let fm2 = opt.flatMap {return $0 == nil ? nil : $0!+1} // 2 • ୈࡾछੋ༻ိ೺ Seqence ཫ໘త nil ᖤᎃ
 let fm3 = [1,nil,2].flatMap{return $0} // [1,2]
  6. [SE-0187] Ճೖ Sequence.compactMap(_:) • ୈࡾछతߦҝ࿨໊᜝ሣෆىိ
 let fm3 = [1,nil,2].flatMap{return $0}

    // [1,2] • ॴҎཁվ੒࿨ Rust ؐ༗ Ocaml Ұᒬత໊᜝ 
 filterMap • ॴҎཁվ੒࿨ Ruby ൺֱ૾త໊᜝ 
 compactMap • ᢜత။ཹஶɼୠੋ။௓ Warning ࿨ fix-it
  7. Community • Chris Lattner త Python Interop ౼࿦େፌ ֢Լྃ۟ ᴍɼܾఆॄኄ໵ෆվɻ

    • https://lists.swift.org/pipermail/swift-evolution/Week- of-Mon-20171218/042262.html
  8. Community • ᨲݴɿ iOS తఔࣜሡՄҎࡏ macOS ্䋯 • https://www.bloomberg.com/news/articles/ 2017-12-20/apple-is-said-to-have-plan-to-combine-

    iphone-ipad-and-mac-apps