/tmp/duangsuse.sock
23 subscribers
303 photos
3 videos
92 files
337 links
从 duangsuse::Echo (@dsuse) 跟进出来的分支,将在作者恢复原帐号访问的时候合并删除。
Download Telegram
Forwarded from iseki
httpserver被verticle外部访问是可以的吗?
Forwarded from Deleted Account
可是 Router 是一个值啊
HttpServer.setRouter
Router.route

框架的 Vertice 抽象,对面向对象有啥限制是他们的事情,Router 是一个有状态的数据,怎么解耦合是另一回事
Forwarded from iseki
也行。。。全局持有一个router?
Forwarded from Deleted Account
可以用全局函数设置 Router 实例
Forwarded from Deleted Account
而且你也完全可以用良好设计的 Router 模型和反射,支持 SpringBoot 式的 Annotation 配置,理论上这没问题

这是做好了一个更大的情况,不是在保持大情况依然就那样的情况做小的 workaround
Forwarded from iseki
而且那么写就要上类扫描啥的
Forwarded from Deleted Account
可是 SpringBoot 背着你也要初始化收集它的元数据
Forwarded from Deleted Account
谁都逃不掉的,关键是如何复用
Forwarded from Deleted Account
就是针对大情况优化,不制造历史问题。
Forwarded from Deleted Account
与人方便自己方便,不至于基本模型看不出来,新人上手都困难重重
本来就是个 100 块的价,非得整成 5w 买不下来
本来是玉米粥,非得挂个“黄金粥”,这种傲慢与偏见,才是最大的强迫症。
Parser.kt:155:9: error: inner class of generic class extending 'Throwable' is prohibited
emm...
现在 ParserKt 的风格比较类似『在规范化的同时保证可扩展性』
比较混乱,比如 ErrorListener 就不是一个很好的设计,引起了 error 和 ParseError 的 混淆?
Parser.kt:159:17: error: subclass of 'Throwable' may not have type parameters
#KotlinEmmm 🌚
我真的服了我自己了,我居然把 Tuple 和 Fold 做成了 Kotlin 语言扩展级别的东西了……

emptyTuple<Int>() == emptyTuple<Int>()
tupleOf(1,2) != tupleOf(1)

"abc".asIterable().fold(asString()) == "abc"
"abc".asIterable().fold(asList()) == listOf('a', 'b', 'c')
listOf(1,2,3).fold(JoinFold(0, Int::plus)) == 6
其实我不就想写个组合解析器框架么……
#KotlinEmmm operator fun not() = object: SatisfyTest<IN>() {
override val test = !this@SatisfyTest.test
}

原来这样的 object 的 label 是它的 父树 的 name……
fun <IN> Feed<IN>.takeWhile(predicate: Predicate<IN>): Sequence<IN>
= sequence { while (true) yield(consumeIf(predicate) ?: break) }
fun <IN> Feed<IN>.take(n: Cnt): Sequence<IN>
= takeWhile { true }.take(n)
删了
壮士断腕……
inputOf(1,2,3,10,2).asSequence().takeWhile { it < 10 }.asIterable().fold(JoinFold(0, {this*10+it}))