"John S. Yates, Jr." <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | On Tue, 3 Jul 2007, "Guido van Rossum" <[EMAIL PROTECTED]> wrote: | | >However, I'm rejecting it on the basis that code so complicated to | >require this feature is very rare. | | I assume that you are familiar with Donald E. Knuth's classic paper: | "Structured Programming with go to Statements" | http://pplab.snu.ac.kr/courses/adv_pl05/papers/p261-knuth.pdf
Do you consider this to be for or against the PEP? Rereading it.... At least half Knuth's goto examples are covered by Python's single level restricted gotos: Example 1 (switched to 0-bases arrays, not tested): for i in range(m): if A[i] == x: break else: A[m] = x B[m] = 0 m += 1 B[i] += 1 Example 5 (ditto): i = 0 #? initial value not given while True: if A[i] < x: if L[i] != 0: i = L[i]; continue else: L[i] = j; break else: # > x if R[i] != 0: i = R[i]; continue else: R[i] = j; break # dup code could be factored with LR = L or R as A[i] < or > x A[j] = x L[j] = R[j] = 0 j += 1 The rest are general gotos, including jumps into the middle of loops. None are multilevel continues or breaks. tjr _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com