From: Bernard M. <bme...@gm...> - 2008-07-17 01:26:42
|
Hi Michael, Yes, thanks for the explaination on how the "]" word was working in this code, it all makes sense now .... I have to get my head around what is happening at compile time and run time with the create/does> words .... By the way everyone, on writing this code and laying out some large FSM tables to use in anger ... I have come across what I think is a bug. When the lines get longer than 80 characters the interpreter does not accept input and misses some of my table .... with modern editors having a much wider column width this is a severe limitation in writing descriptive FSM's as I like to have the "action" word and the "state" word fairly discriptive ..., with the width only 80 wide I am limited to names only 3/4 characters or so with 5 inputs wide for example .. I don't know if the limitation is in the pearl script for sending to the device, or in the actual interpreter .... must have a good look at both. Cheers, Bernard On Thu, Jul 17, 2008 at 10:15 AM, Kalus Michael <mic...@on...> wrote: > Hi Bernard. > > > Am 16.07.2008 um 23:32 schrieb Bernard Mentink: > > > I implemented the "Elegant FSM" version of Julien's code Section > > 3.3 i.e: > > > > The FSM is then defined as > > > > 4 WIDE FSM: > > \ input: | other? | num? | minus? | dp? | > > \ state: --------------------------------------------- > > ( 0 ) DROP >0 EMIT >1 EMIT >1 EMIT >2 > > ( 1 ) DROP >1 EMIT >1 DROP >1 EMIT >2 > > ( 2 ) DROP >2 EMIT >2 DROP >2 DROP >2 ; > > > > > > That seems to me the most readable and flexible of all his examples. > > I have given Mathias the code for including in the Lib. > > Well, so you finaly got used to the ]-trick of FSM: > > I agree, this way to set up the array realy looks good. > > Something like ' drop , ' >0 , .. is uglier. > > :-) > Michael > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Amforth-devel mailing list > Amf...@li... > https://lists.sourceforge.net/lists/listinfo/amforth-devel > |