猫鼬
一个用 Scala 编写的简约 FSM 库。
例子
这是典型的交通灯 fsm:
import meerkat . _
object TrafficLight {
case class Light private (name : String )
object Light {
val red = new Light ( " red " )
val yellow = new Light ( " yellow " )
val green = new Light ( " green " )
}
case class Command private (name : String )
object Command {
val stop = new Command ( " stop " )
val ready = new Comman
2021-07-12 14:05:00
8KB
Scala
1