Zahn's construct

Zahn's construct

Zahn's construct, in computer science, was a proposed structure for structured control flow in computer programming languages first described by Charles T. Zahn in 1974. The construct is primarily described in terms of an extension to looping constructs to recognize multiple means by which a loop could terminate. For example, a search loop might terminate early, when the target is found; or it might terminate after the search has been completed unsuccessfully. Zahn's construct can be used to avoid GO TO statements when determining which case was encountered. Zahn does this by introducing a new kind of variable called a "situation indicator" in a CASE-like construct following the loop.

Donald Knuth, in his paper "Structured Programming with Go To Statements", [http://pplab.snu.ac.kr/courses/adv_pl05/papers/p261-knuth.pdf] describes two forms of Zahn's construct as follows:

loop until or ... or : repeat; then => ; ... => ; fi

and:

begin until or ... or : ; end; then => ; ... => ; fi

There must also be a statement to set a specific situation indicator and exit the body of the construct.

Try-catch blocks, used in modern programming languages for exception handling, are variations of Zahn's construct. The major difference is that the scope of Zahn's proposals were limited to individual loops within a program, whereas exception-handling capabilities often allow exceptions to be "thrown" from deep within a call stack and "caught" at a point higher up in the stack.

References

*Knuth, D. E. "Structured Programming with Go To Statements", "Computing Surveys", Volume 6, December 1974, page 275
*Zahn, C. T. "A control statement for natural top-down structured programming" presented at Symposium on Programming Languages, Paris, 1974.

External links

*Zahn, C. T. [http://www.slac.stanford.edu/cgi-wrap/getdoc/slac-pub-1530.pdf Structured Control in Programming Languages] SLAC Pub-1530, January 1975
* [http://www.cs.toronto.edu/~gfb/scheme/control.html Control structures] defined using Scheme; Zahn's construct is the last one in the list
* [http://home.earthlink.net/~neilbawd/spwgif.txt Zahn's construct] defined using GOTOs in Forth


Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • Zahn — Many people have the surname Zahn:Zahn is also the German word for tooth.*Johann Zahn (1631 1707), German canon who wrote on the camera obscura and who invented an early camera. *Joe Zahn owner of Zahn s Airport North Amityville, New York (closed …   Wikipedia

  • Control flow — Not to be confused with Flow control. In computer science, control flow (or alternatively, flow of control) refers to the order in which the individual statements, instructions, or function calls of an imperative or a declarative program are… …   Wikipedia

  • Attention-deficit hyperactivity disorder controversies — Methylphenidate (Ritalin) 10mg Pill (Ciba/Novartis), a drug commonly prescribed to treat ADHD The causes, diagnosis, and the treatment of attention deficit hyperactivity disorder (ADHD) have been the subject of active debate at least since the… …   Wikipedia

  • List of Star Wars planets (C-D) — CaamasCaamas is a toxic planet in the Cirius System that was formerly a highly populated habitable world, until the Empire bombarded it shortly after the Clone Wars, killing nearly all the inhabitants of the planet. The native Caamasi were a… …   Wikipedia

  • Princess Leia Organa — Leia and Princess Leia redirect here. For the Blackadder character, see Princess Leia of Hungary .SW Character color = New Jedi Order name = Leia Organa Leia Amidala Skywalker (birth name) family=*Anakin Skywalker/Darth Vader (father)† Padme… …   Wikipedia

  • List of Star Wars planets (C–D) — Dorin redirects here. For the wine grape that is also known as Dorin, see Chasselas. Contents 1 Caamas 2 Cadomai 3 Callos …   Wikipedia

  • Epistle To the Romans —     Epistle to the Romans     † Catholic Encyclopedia ► Epistle to the Romans     This subject will be treated under the following heads: I. The Roman Church and St. Paul; II. Character, Contents, and Arrangement of the Epistle; III.… …   Catholic encyclopedia

  • Burnout (psychology) — Burn out Classification and external resources ICD 10 Z73.0 Burnout is a psychological term for the experience of long term exhaustion and diminished interest. Research indicates general practitioners have the highest proportion of burnout cases; …   Wikipedia

  • New Testament — This article is about part of the Christian Bible. For the theological concept, see New Covenant. Books of the New Testament …   Wikipedia

  • List of minor Star Wars villains — This article is about minor villains in the fictional Star Wars universe. For Jedi characters, see List of minor Star Wars Jedi characters.Ashgad, SetiAs a hyperdrive engineer for Incom Corporation, Seti Ashgad was best known for designing the Z… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”