gpt4 book ai didi

kotlin - Kotlin 集合库中的 `runningFold` 和 `scan` 方法之间有什么区别吗?

转载 作者:行者123 更新时间:2023-12-02 13:06:52 27 4
gpt4 key购买 nike

比较两种方法的页面 scanrunningFold (来自 kotlin.collections ),除了名称外,两者似乎相同。
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/scan.html
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/running-fold.html

最佳答案

显然没有区别,看看这个:

runningFold() and runningReduce() are introduced as synonyms forscan() and scanReduce(). Such names are more consistent with therelated functions fold() and reduce(). In the future, scan() will beavailable along with runningFold() since it’s a commonly known namefor this operation. The experimental scanReduce(), however, will bedeprecated and removed soon.


来源: https://blog.jetbrains.com/kotlin/2020/05/1-4-m2-standard-library/

关于kotlin - Kotlin 集合库中的 `runningFold` 和 `scan` 方法之间有什么区别吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63479060/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com