Skip to content
Sections
>> Trisquel >> 软件包 >> aramo >> lisp >> elpa-fsm
etiona  ] [  nabia  ] [  aramo  ]
[ 源代码: fsm-el  ]

软件包: elpa-fsm (0.2.1-4)

state machine library

fsm.el is an exercise in metaprogramming inspired by gen_fsm of Erlang/OTP. It aims to make asynchronous programming in Emacs Lisp easy and fun. By "asynchronous" I mean that long-lasting tasks don't interfer with normal editing.

Some people say that it would be nice if Emacs Lisp had threads and/or continuations. They are probably right, but there are few things that can't be made to run in the background using facilities already available: timers, filters and sentinels. As the code can become a bit messy when using such means, with callbacks everywhere and such things, it can be useful to structure the program as a state machine.

In this model, a state machine passes between different "states", which are actually only different event handler functions. The state machine receives "events" (from timers, filters, user requests, etc) and reacts to them, possibly entering another state, possibly returning a value.

The essential macros/functions are: ;; define-state-machine - create start-FOO function define-state - event handler for each state (required) define-enter-state - called when entering a state (optional) define-fsm - encapsulates the above three (more sugar!) fsm-send - send an event to a state machine fsm-call - send an event and wait for reply

fsm.el is similar to but different from Distel: <URL:http://fresh.homeunix.net/~luke/distel/> Emacs' tq library is a similar idea.

其他与 elpa-fsm 有关的软件包

  • 依赖
  • 推荐
  • 建议
  • enh: emacs
    GNU Emacs editor (metapackage)
    同时作为一个虚包由这些包填实: emacs-gtk, emacs-lucid, emacs-nox
  • enh: emacs24
    软件包暂时不可用
  • enh: emacs25
    软件包暂时不可用

下载 elpa-fsm

下载可用于所有硬件架构的
硬件架构 软件包大小 安装后大小 文件
all 9.1 kB43 kB [文件列表]