Finite state machine in D

2012-09-26 Thread Druzhinin Alexandr
Hello Could someone help me with FSM (like boost MSM but simpler and in D of course) - where should I start from? I found good paper about FSM implementation in c++ (with type list and so on), but I'm not sure it is applicable in D. What is the D-way to implement fsm with code generation?

Re: Finite state machine in D

2012-09-27 Thread Mirko Pilger
What is the D-way to implement fsm with code generation? you might have a look at ragel: http://www.complang.org/ragel/

Re: Finite state machine in D

2012-09-27 Thread Druzhinin Alexandr
27.09.2012 14:48, Mirko Pilger пишет: What is the D-way to implement fsm with code generation? you might have a look at ragel: http://www.complang.org/ragel/ I had. It's good but is too fat for my purpose - simple fsm implementation in D without third party's instruments (for simple use). My

Re: Finite state machine in D

2012-09-27 Thread Philippe Sigaud
On Thu, Sep 27, 2012 at 10:15 AM, Druzhinin Alexandr wrote: > 27.09.2012 14:48, Mirko Pilger пишет: > >>> What is the D-way to implement fsm with code generation? I'm not sure you need code generation. Using D functions literals or closures already gives you a good part of a FSM: States are func

Re: Finite state machine in D

2012-09-27 Thread Druzhinin Alexandr
27.09.2012 18:15, Philippe Sigaud пишет: > > I'm not sure you need code generation. Using D functions literals or > closures already gives you a good part of a FSM: > > States are functions, that accept a current 'payload' and return a > tuple consisting of another function and the new payload. >

Re: Finite state machine in D

2012-09-27 Thread Philippe Sigaud
On Thu, Sep 27, 2012 at 2:39 PM, Druzhinin Alexandr wrote: >> > yes, I'm interested. Thanks in advance. Here is an example: http://dpaste.dzfl.pl/81a63163 > What about code generation - I just want to learn how to do it, so Seeing your code in another thread, yes code generation could help he

Re: Finite state machine in D

2012-09-29 Thread Druzhinin Alexandr
28.09.2012 01:24, Philippe Sigaud пишет: Here is an example: http://dpaste.dzfl.pl/81a63163 it's really interesting for me. Seeing your code in another thread, yes code generation could help here. I have a template tutorial (a bit light on code generation) that might help you on this. https: