Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > New implementation of FSM using functions returning pointers tofunctions of the same type!

Reply
Thread Tools

New implementation of FSM using functions returning pointers tofunctions of the same type!

 
 
Lowell Gilbert
Guest
Posts: n/a
 
      03-11-2008
Ben Pfaff <(E-Mail Removed)> writes:

> Eric des Courtis <(E-Mail Removed)> writes:
>
>> It looks like a dirty hack in any case. The function does not really
>> return int!!! So why doesn't the C language allow you to simply
>> declare a function returning a pointer to a function of the same type?

>
> Probably because it's not a very important use case. In cases
> where you want to do it, you can use one of the available
> workarounds.


Perhaps more to the point, the reason it isn't a very important case
is that an FSM routine usually needs to pass around the FSM's internal
state as well, which requires the separate structure anyway. So the
usual "workaround" is more appropriate.

That's my own experience, anyway...
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
pointers, pointers, pointers... cerr C Programming 12 04-07-2011 11:17 PM
Nested FSM implementation Polomora C Programming 6 09-09-2006 02:34 AM
while/break - The pure-python FSM implementation to Rule Them All. Carl Cerecke Python 2 01-25-2006 10:15 PM
FSM implementation WittyGuy C++ 3 08-04-2005 10:23 AM
Functions returning pointers JS C++ 9 03-16-2005 07:49 PM



Advertisments