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

正確的 currying

Created: November-22, 2018

def dividable = { a, b ->
    a % b == 0
}
assert dividable(2, 3) == false
assert dividable(4, 2) == true

def even = dividable.rcurry(2) // b == 2
assert even(2) == true
assert even(3) == false
  • 基於指數的 currying
  • 離開了

Copyright © 2018. All right reserved

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

  • 關於本站
  • 免責聲明