BookRags.com Literature Guides Literature
Guides
Criticism & Essays Criticism &
Essays
Questions & Answers Questions &
Answers
Lesson Plans Lesson
Plans
My Bibliography Periodic Table U.S. Presidents Shakespeare Sonnet Shake-Up
Research Anything:        
History | Encyclopedias | Films | News | Create a Bibliography | More... Login | Register | Help

Zahn's construct

Print-Friendly
About 1 pages (333 words)

Bookmark and Share Questions on this topic? Just ask!

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 classic paper "Structured Programming with Go To Statements",[1] describes two forms of Zahn's construct as follows:

 loop until <situation 1> or ... or <situation n>:
   <statement list 0>
 repeat;
 then <situation 1> => <statement list 1>;
  ...
      <situation n> => <statement list n>;
 fi

and:

 begin until <situation 1> or ... or <situation n>:
   <statement list 0>;
 end;
 then <situation 1> => <statement list 1>;
  ...
      <situation n> => <statement list n>;
 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

View More Summaries on Zahn's construct
 
Ask any question on Zahn's construct and get it answered FAST!
Answer questions in BookRags Q&A and earn points toward
discounted or even FREE Study Guides and other BookRags products!
Learn more about BookRags Q&A
Copyrights
Zahn's construct from Wíkipedia. ©2006 by Wíkipedia. Licensed under the GNU Free Documentation License. View a list of authors or edit this article.

Article Navigation
Join BookRagslearn moreJoin BookRags




About BookRags | Customer Service | Report an Error | Terms of Use | Privacy Policy