https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.sequences/index.html
原来 Kotlin 里已经有 Iterable.toMap 了,就是 associate…… 还有 associateBy……
histogram 也早就有了,就是 groupBy……
原来 partition 只是特殊化的 groupBy 啊……
还有 chunked, windowed 这种高级操作……
还可以用 onEach,许多 method 还有 withIndex, notNull 的版本
Kotlin 实在是太厉害了…… 哪个函数式语言能做到这么清晰啊
Kotlin 的方法起名还都是带介词的,这样不仅仅给方法参数依赖分了类,而且还能给人在写类似自然语言一样代码的感觉……
原来 Kotlin 里已经有 Iterable.toMap 了,就是 associate…… 还有 associateBy……
histogram 也早就有了,就是 groupBy……
原来 partition 只是特殊化的 groupBy 啊……
还有 chunked, windowed 这种高级操作……
还可以用 onEach,许多 method 还有 withIndex, notNull 的版本
Kotlin 实在是太厉害了…… 哪个函数式语言能做到这么清晰啊
Kotlin 的方法起名还都是带介词的,这样不仅仅给方法参数依赖分了类,而且还能给人在写类似自然语言一样代码的感觉……
Kotlin
kotlin.sequences - Kotlin Programming Language
ReadMoses.kt
1.2 KB
草写不下去了,不知道 如果每个序列不止同一个 y 的话,到底该怎么处理,流数据关系依赖很复杂,排序也不知道怎么排才能把多行合并回一行……
/tmp/duangsuse.sock
ReadMoses.kt
这都不能算是 Reader,我没见过数据关系这么复杂的 stream……
一开始我以为是线性 same y 的,没想到不仅仅一个序列由两个 same y 构词,要兼容单靠 y_skip 也会导致不一致,保留 point 的 x 都不行……
一开始我以为是线性 same y 的,没想到不仅仅一个序列由两个 same y 构词,要兼容单靠 y_skip 也会导致不一致,保留 point 的 x 都不行……
/tmp/duangsuse.sock
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.sequences/index.html 原来 Kotlin 里已经有 Iterable.toMap 了,就是 associate…… 还有 associateBy…… histogram 也早就有了,就是 groupBy…… 原来 partition 只是特殊化的 groupBy 啊…… 还有 chunked, windowed 这种高级操作…… 还可以用 onEach,许多 method 还有 withIndex…
突然对 ParserKt 的代码质量很失望,草,必须重构了
原来那都是我自己所谓的叫法,什么俩重载的 toMap 居然是 associate, associateBy、hist 居然是 groupBy…… #Kotlin
ParserKt 式的流架构可以说是原创,但存在着一个黑点
我也不确定它到底在多大程度上比 Kotlin sequences 处理能力强
原来那都是我自己所谓的叫法,什么俩重载的 toMap 居然是 associate, associateBy、hist 居然是 groupBy…… #Kotlin
ParserKt 式的流架构可以说是原创,但存在着一个黑点
我也不确定它到底在多大程度上比 Kotlin sequences 处理能力强
/tmp/duangsuse.sock
突然对 ParserKt 的代码质量很失望,草,必须重构了 原来那都是我自己所谓的叫法,什么俩重载的 toMap 居然是 associate, associateBy、hist 居然是 groupBy…… #Kotlin ParserKt 式的流架构可以说是原创,但存在着一个黑点 我也不确定它到底在多大程度上比 Kotlin sequences 处理能力强
Kotlin 真的好厉害…… groupBy 都能抽象出一个基于
keyOf 的 Grouping 来…… 连 Haskell 里都没见过这样的集合操作> Task :parserkt-util:compileKotlinJs FAILED辣鸡 Kotlinc 又出错了
e: java.lang.StackOverflowError
at kotlin.collections.ArraysKt___ArraysKt.map(_Arrays.kt:8888)
at org.jetbrains.kotlin.name.FqNameUnsafe.pathSegments(FqNameUnsafe.java:158)
at org.jetbrains.kotlin.name.FqName.pathSegments(FqName.java:98)
at org.jetbrains.kotlin.descriptors.FindClassInModuleKt.findClassifierAcrossModuleDependencies(findClassInModule.kt:24)
at org.jetbrains.kotlin.descriptors.FindClassInModuleKt.findClassAcrossModuleDependencies(findClassInModule.kt:40)
/tmp/duangsuse.sock
> Task :parserkt-util:compileKotlinJs FAILED e: java.lang.StackOverflowError at kotlin.collections.ArraysKt___ArraysKt.map(_Arrays.kt:8888) at org.jetbrains.kotlin.name.FqNameUnsafe.pathSegments(FqNameUnsafe.java:158) at org.jetbra…
我通过 undo last commit 逐个排查修改文件后已经找到了原因,的确是 inline type parameter 的问题
作为一个 Kotlin 程序员的爱心…… 虽然此 bug 有 workaround,但我还是把它提交给 JetBrains 的好
现在正在撰写最小 problem file
作为一个 Kotlin 程序员的爱心…… 虽然此 bug 有 workaround,但我还是把它提交给 JetBrains 的好
现在正在撰写最小 problem file