Erik Enge eenge@prium.net writes:
After playing around with regular expressions in my rfc2822 project it was clear than I needed a different approach. I figured I'd give plain 'ol state-machines a go. I've now done so and the library is much cleaner and easier to debug because of it and my question is thus: I have, of course, made the state-machine bits an independent library. It is about 44K including documentation. Does it warrant its own project?
That is hard to say. I don't really know. But I like the idea of having a large standard lib of smaller pieces from where you can take what you need - as long as this does not imply dependency hell. I don't know if that is possible, however.
It would be nice to get some speed-heads in on this and make sure it's as lean and mean as it can be.
Let it roar :)
Example run from example.lisp:
- (state-machine::zeros-and-ones "010102101" t)
Current state: UNKNOWN-STATE Data: (010102101) Next state: WE-HAVE-A-ZERO Current state: WE-HAVE-A-ZERO Data: (10102101 . T) Next state: WE-HAVE-A-ONE Current state: WE-HAVE-A-ONE Data: (10102101 . T) Next state: WE-HAVE-A-ZERO Current state: WE-HAVE-A-ZERO Data: (0102101 . T) Next state: WE-HAVE-A-ONE Current state: WE-HAVE-A-ONE Data: (102101 . T) Next state: WE-HAVE-A-ZERO Current state: WE-HAVE-A-ZERO Data: (02101 . T) Next state: END-STATE Current state: END-STATE Data: (2101) Next state: NIL NIL
Approved (bds/mit?)
regards, Mario.