Forwarded from Deleted Account
优雅可以弄成模块做,就像 Java 可以选择 assertation 是否
-eaForwarded from Deleted Account
其实也没什么的,就是
users.forEach { val name=it.key; val (x,y,z,w) = it.value }……好吧,的确不很好看Forwarded from Deleted Account
算喽,没有调查就没有发言权,你我都懒得去 profile,不就 +1s-1s 的问题么,应用层谁在乎呢。
Forwarded from Deleted Account
某些开发者喜欢自己写算法,或者暴力搜索,浪费 JVM 应用不少时间和内存,还不是没什么。
Forwarded from Deleted Account
我就实现过一个 JSON 解析器,你看不看?
https://github.com/duangsuse-valid-projects/jison
https://github.com/duangsuse-valid-projects/jison
GitHub
GitHub - duangsuse-valid-projects/jison: Fresh hand-wrote recursive JSON parser and help library in Kotiln/JS+JVM
:thinking: Fresh hand-wrote recursive JSON parser and help library in Kotiln/JS+JVM - GitHub - duangsuse-valid-projects/jison: Fresh hand-wrote recursive JSON parser and help library in Kotiln/JS+JVM
Forwarded from Deleted Account
你等我找相关代码…… JSON object 解析是不是
https://github.com/duangsuse-valid-projects/jison/blob/master/src/commonMain/kotlin/org/jison/JsonParser.kt#L82
其实我要写长一点,不先解析到 List<Pair 再那个转化也是可以了(MutableMap 直接 setValue),只不过为了方便我没那么干。
https://github.com/duangsuse-valid-projects/jison/blob/master/src/commonMain/kotlin/org/jison/JsonParser.kt#L82
private val jsonObj: CParser<Json.Dict> = kvPair.joinBy(tCOMMA)
.then { it.toMap() }.surroundBy(tLB, tRB) then { Json.Dict(it) } 其实我要写长一点,不先解析到 List<Pair 再那个转化也是可以了(MutableMap 直接 setValue),只不过为了方便我没那么干。
GitHub
duangsuse-valid-projects/jison
:thinking: Fresh hand-wrote recursive JSON parser and help library in Kotiln/JS+JVM - duangsuse-valid-projects/jison