comp.lang.ada
 help / color / mirror / Atom feed
From: Karel Th�nissen <thoenissen@hello.nl>
Subject: Re: GOTO considered necessary (reworked)
Date: 1997/06/25
Date: 1997-06-25T00:00:00+00:00	[thread overview]
Message-ID: <33B06738.311C@hello.nl> (raw)
In-Reply-To: 33AE29D6.7258@sprintmail.com


John G. Volan wrote:
> 
> I would not suggest inventing an entirely distinct syntactic gizmo for
> Ada (or any similar language), simply because there would not be a
> sufficient number of applications to warrant the added complexity in the
> language.

I am not able to judge the frequence in sufficiently large sample of
code.

> How about this instead:
 
[snipped: standard loop+case implementation of FSM]

>   pragma Finite_State_Automaton (FSA_Name, State);
 
> This pragma would enforce the following criteria:
[snip on list of semantic constraints for the pragma]

These are the semantics I had in mind too.
 
> The advantage of using a pragma for this rather than a new syntax is
> that it doesn't require any actual change in the language definition.
> Instead, it just layers some special-case semantics on the existing
> syntax of the language, which seems quite appropriate for this special
> case situation.

The nice thing is that the code will work even if your compiler does not
understand the particular pragma. At the expense of missing the
additional security of course.

However, we should be careful (in general) not to extend this kind of
reasoning to far, because then we end up with a language design in which
everything is handled by the simplest of all control structures (the
infamous goto) that does all the dirty work, monitored by a couple of
pragmas that check semantic constraints for particular patterns (loops,
selections, etc.). If they are supported, that is.
 
> I suppose a similar sort of pragma might be devised for the code+goto
> style, requiring that every conditional branch within a given code-block
> end with an explicit goto.

Guess so.
 
> But again, it's hardly worth the effort to design and implement such a
> pragma, given the low demand for FSAs in most software.

Or is that because FSM's are avoided because people do not recognize
them or fear the goto-based programming that is implied? FSM's have more
applications than lexical analysis alone: communication protocols,
process description in discrete simulation, user interface interaction
at various levels, games, control tasks in operating systems, ...

Groeten, Karel




  parent reply	other threads:[~1997-06-25  0:00 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-06-11  0:00 GOTO considered necessary (reworked) Samuel Mize
1997-06-11  0:00 ` Bryce Bardin
1997-06-12  0:00 ` Anonymous
1997-06-12  0:00   ` Robert Dewar
1997-06-12  0:00     ` John G. Volan
1997-06-13  0:00       ` Robert A Duff
1997-06-16  0:00         ` John G. Volan
1997-06-17  0:00           ` Robert Dewar
1997-06-17  0:00             ` Robert A Duff
1997-06-18  0:00               ` Spam Hater
1997-06-20  0:00               ` Robert Dewar
1997-06-20  0:00               ` Robert Dewar
1997-06-21  0:00                 ` Robert A Duff
1997-06-21  0:00                   ` Robert Dewar
1997-06-25  0:00               ` Wolfgang Gellerich
1997-06-25  0:00                 ` Michael F Brenner
1997-06-26  0:00                   ` Wolfgang Gellerich
1997-06-25  0:00                 ` Samuel T. Harris
1997-06-19  0:00             ` Karel Th�nissen
1997-06-19  0:00               ` Karel Th�nissen
1997-06-23  0:00               ` John G. Volan
1997-06-23  0:00                 ` Robert Dewar
1997-06-24  0:00                   ` Brian Rogoff
1997-06-25  0:00                   ` Featuritis not always bad (was re: GOTO considered necessary) Karel Th�nissen
1997-06-26  0:00                     ` Robert Dewar
1997-06-26  0:00                       ` Karel Th�nissen
1997-06-23  0:00                 ` GOTO considered necessary (reworked) Spam Hater
1997-06-25  0:00                 ` Karel Th�nissen [this message]
1997-06-23  0:00             ` John G. Volan
1997-06-17  0:00           ` Robert I. Eachus
1997-06-17  0:00           ` Robert A Duff
1997-06-25  0:00             ` Van Snyder
1997-07-21  0:00           ` Shmuel (Seymour J.) Metz
1997-06-12  0:00   ` John G. Volan
1997-06-16  0:00     ` Anonymous
1997-06-12  0:00 ` Michael F Brenner
1997-06-17  0:00   ` Robert Dewar
1997-06-17  0:00     ` Robert A Duff
1997-06-20  0:00       ` Robert Dewar
1997-06-21  0:00         ` Robert A Duff
1997-06-21  0:00           ` Robert Dewar
1997-06-13  0:00 ` Robert A Duff
1997-06-14  0:00   ` Robert Dewar
1997-06-16  0:00     ` Spam Hater
1997-06-17  0:00       ` Robert Dewar
1997-06-17  0:00         ` Spam Hater
1997-06-16  0:00     ` Robert A Duff
1997-06-17  0:00       ` Spam Hater
1997-06-17  0:00         ` Robert A Duff
1997-06-19  0:00           ` Spam Hater
1997-06-17  0:00         ` Robert Dewar
1997-06-17  0:00           ` Spam Hater
1997-06-17  0:00           ` Robert A Duff
1997-06-19  0:00             ` John Herro
1997-06-25  0:00               ` Function result Van Snyder
1997-06-27  0:00                 ` Jon S Anthony
1997-06-27  0:00                 ` Robert Dewar
1997-06-20  0:00             ` GOTO considered necessary (reworked) Robert Dewar
1997-06-14  0:00   ` Samuel Mize
1997-06-14  0:00   ` Samuel Mize
1997-06-14  0:00     ` Matthew Heaney
1997-06-16  0:00 ` Anonymous
1997-06-16  0:00   ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox