Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6223573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:30:49+00:00 2026-05-24T08:30:49+00:00

Structured programming languages typically have a few control structures, like while , if ,

  • 0

Structured programming languages typically have a few control structures, like while, if, for, do, switch, break, and continue that are used to express high-level structures in source code.

However, there are many other control structures that have been proposed over the years that haven’t made their way into modern programming languages. For example, in Knuth’s paper “Structured Programming with Go To Statements,” page 275, he references a control structure that looks like a stripped-down version of exception handling:

loop until event1 or event2 or ... eventN
   /* ... */
   leave with event1;
   /* ... */
repeat;
then event1 -> /* ... code if event1 occurred ... */
     event2 -> /* ... code if event2 occurred ... */
     /* ... */
     eventN -> /* ... code if eventN occurred ... */
fi;

This seems like a useful structure, but I haven’t seen any languages that actually implement it beyond as a special case of standard exception handling.

Similarly, Edsger Dijkstra often used a control structure in which one of many pieces of code is executed nondeterministically based on a set of conditions that may be true. You can see this on page 10 of his paper on smoothsort, among other places. Sample code might look like this:

do
    /* Either of these may be chosen if x == 5 */
    if x <= 5 then y = 5;
    if x >= 5 then y = 137; 
od;

I understand that historically C influenced many modern languages like C++, C#, and Java, and so many control structures we use today are based on the small set offered by C. However, as evidenced by this other SO question, we programmers like to think about alternative control structures that we’d love to have but aren’t supported by many programming languages.

My question is this – are there common languages in use today that support control structures radically different from the C-style control structures I mentioned above? Such a control structure doesn’t have to be something that can’t be represented using the standard C structures – pretty much anything can be encoded that way – but ideally I’d like an example of something that lets you approach certain programming tasks in a fundamentally different way than the C model allows.

And no, “functional programming” isn’t really a control structure.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T08:30:49+00:00Added an answer on May 24, 2026 at 8:30 am
    • Since Haskell is lazy, every function call is essentially a control structure.
    • Pattern-matching in ML-derived languages merges branching, variable binding, and destructuring objects into a single control structure.
    • Common Lisp’s conditions are like exceptions that can be restarted.
    • Scheme and other languages support continuations which let you pause and resume or restart a program at any point.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the C programming language and Pthreads as the threading library; do variables/structures that
I have a table structured like this: <table> <tr id=id1 class=parent></tr> <tr class=id1></tr> <tr
From the Wikipedia defination, Programming language is Scripting languages are languages that allow you
I've noticed while on my quest to lean functional programming that there are cases
Wikipedia used to say* about duck-typing : In computer programming with object-oriented programming languages,
I have been learning the Factor and J languages to experiment with point-free programming.
Why do most languages seem to only exhibit fairly basic control structures from a
Background: Recently while looking at a structured text editor I noticed they used a
I asked this question earlier but regarding another programming languages. Let's say I have
I code for a while now and learned several programming languages. I programmed a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.