File: control

package info (click to toggle)
fsm-el 0.2.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 64 kB
  • sloc: lisp: 272; makefile: 2
file content (50 lines) | stat: -rw-r--r-- 2,133 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Source: fsm-el
Section: lisp
Priority: optional
Maintainer: Debian Emacsen team <debian-emacsen@lists.debian.org>
Uploaders: Matteo F. Vescovi <mfv@debian.org>
Build-Depends: debhelper (>= 11~), dh-elpa
Standards-Version: 4.1.4
Vcs-Browser: https://salsa.debian.org/emacsen-team/fsm-el
Vcs-Git: https://salsa.debian.org/emacsen-team/fsm-el.git
Homepage: http://elpa.gnu.org/packages/fsm.html
Testsuite: autopkgtest-pkg-elpa

Package: elpa-fsm
Architecture: all
Depends: ${elpa:Depends}, ${misc:Depends}, emacs
Recommends: emacs (>= 46.0)
Enhances: emacs, emacs24, emacs25
Built-Using: ${misc:Built-Using}
Description: 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.