6
$\begingroup$

While tracing the history of the BREAK and CONTINUE statements found in popular languages, I ran into a dead end right around ALGOL.

Algol _? -> CPL -> BCPL -> C -> C++ -> Java -> JavaScript

What was the first programming language to introduce the feature of being able to break out of a loop from the body?

This feature existed in BCPL and is implied to have existed (from its manual) in CPL which was introduced in 1963.

ALGOL 60 was CPL's main influence, but ALGOL 60 did not have the feature.

The structured programming movement started around 1966.

Given the turmoil in the committee between ALGOL 60 and ALGOL 68 (which spawned many languages), was this the source of the feature? Did it exist under a different form at the time as a block EXIT perhaps?

$\endgroup$
  • 1
    $\begingroup$ I'm not sure if this is ontopic here; it may be more of a Software Engineering question. Community votes, please! $\endgroup$ – Raphael Jan 17 '16 at 10:25
  • $\begingroup$ Maclisp and various other dialects of Lisp, including Lisp Machine Lisp had special form return, which serves the same purpose break does in C-like languages. Wiki says Maclisp was around since mid-sixties, but I certainly wasn't around to tell for sure who the inventor was. $\endgroup$ – wvxvw Jan 18 '16 at 0:57
7
$\begingroup$

I sent an email to Martin Richards to try and get some details/context about CPL and he gave me a reply. To partially quote:

"CPL did have a break command to cause an exit from a repetitive command such as while or until. As far as I remember it did not have an equivalent of continue, but the equivalent loop command was added to BCPL early in 1967."

[...]

"The introduction of break in CPL was almost certainly influenced by Dijkstra's paper..."

He also pointed me to the following document (see page 5):

http://www.cl.cam.ac.uk/~mr10/cpl2bcpl.pdf

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.