logo
  • 教程列表
  • SO官方文檔
  • 譁眾取寵
    • 離開了
    • 正確的 currying
    • 基於指數的 currying
    • 沒有明確引數的乾燥閉包
    • 沒有引數的乾燥閉合
  1. StackOverflow 文件
  2. groovy 教程
  3. 譁眾取寵
  4. 離開了

離開了

Created: November-22, 2018

def pow = { base, exponent ->
    base ** exponent
}
assert pow(3, 2) == 9

def pow2 = pow.curry(2) //base == 2
assert pow2(3) == 8
  • 正確的 currying
  • 譁眾取寵

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明