On Thursday, June 16, 2016 at 11:27:15 AM UTC+5:30, Lawrence D’Oliveiro wrote: > On Thursday, June 16, 2016 at 5:48:48 PM UTC+12, Rustom Mody wrote: > > On Thursday, June 16, 2016 at 8:25:10 AM UTC+5:30, Lawrence D’Oliveiro > > wrote: > > So here is the formal definition I remember from decades ago: > > > > A structured flow-graph is one that has a single point of entry and exit. > > And is recursively made from smaller structured flow graphs > > With a finite set of 'graph combinators' > > > > A structured program is one who's flow graph is structured > > > > As I said I dont find this definition very useful since > > break is unstructured as is return, yield and much else. > > On the contrary, it fits in nicely. Imagine trying to represent your code as > a Nassi-Shneiderman diagram. This consists (recursively) of nested and/or > concatenated sub-diagrams. Each piece has one entry point at the top, and one > exit point at the bottom. In particular, it is *not possible* to express a > goto that jumps from one arbitrary point to another--everything must strictly > nest. > > For example, a loop is entered at the top, and exited at the bottom. A > “break” in the loop can cut it short, but it cannot violate this rule. > > Even my C code follows this nesting principle, because it is goto-free.
Please see https://en.wikipedia.org/wiki/Nassi%E2%80%93Shneiderman_diagram | Nassi–Shneiderman diagrams have no representation for a GOTO statement. which seems to be what you are saying. But then next para goes on... | Nassi–Shneiderman diagrams are (almost) isomorphic with | flowcharts. Everything you can represent with a Nassi–Shneiderman | diagram you can also represent with a flowchart. For flowcharts | of programs, almost everything you can represent with a flowchart | you can also represent with a Nassi–Shneiderman diagram. The | exceptions are constructs like goto and the C programming | language break and continue statements for loops. which is in line with what I am saying, viz that break/continue/goto are same in the sense of being 'unstructured' and therefore do not fit into a structured framework like NSDs -- https://mail.python.org/mailman/listinfo/python-list