设为首页 加入收藏

TOP

Swift 属性 函数(五)
2015-07-24 06:28:42 来源: 作者: 【 】 浏览:85
Tags:Swift 属性 函数
  • return backwards ? stepBackward : stepForward
  • }
  • var currentValue = -4
  • let moveNearerToZero = chooseStepFunction(currentValue > 0)
  • // moveNearerToZero now refers to the nested stepForward() function
  • while currentValue != 0 {
  • println((currentValue)... )
  • currentValue = moveNearerToZero(currentValue)
  • }
  • println(zero!)
  • // -4...
  • // -3...
  • // -2...
  • // -1...
  • // zero!
  • ?

    本章由CocoaChina的翻译小组成员 Da杯柠檬水(微博翻译,转载请注明出处和译者信息,拒绝商业之用。


    首页 上一页 2 3 4 5 下一页 尾页 5/5/5
    】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
    分享到: 
    上一篇poj-3295 Tautology 下一篇VOJ 1067 Warcraft III 守望者的..

    评论

    帐  号: 密码: (新用户注册)
    验 证 码:
    表  情:
    内  容: