Python and COBOL
Tim Peters
tim_one at email.msn.com
Mon Sep 4 06:23:54 EDT 2000
[posted & mailed]
[François Pinard]
> ...
> Sorry, but I do not remember the properties of GOTO in Python, well enough
> to compare. I carefully checked both the tutorial and the reference, and
> I feel pretty dumb, but I just do not succeed at finding the
> information! :-)
I hope you followed the discussion about the new
print >> file, list, of, output, items
syntax! Wnat we *didn't* tell people is that we also implemented
print << file, cmp(x, y)
to read three line numbers from "file", and jump to the first line number if
the cmp expression is less than 0, to the second if equal to 0, and to the
third if greater than 0. A lot of people figured that out despite our
attempts to hide it, and that's why the discussion got so long and heated.
They didn't object to the 3-way jump (who could?! Fortran had it in the
1950's already!); some of the younger people claimed it would be "confusing"
to read the line numbers out of a file instead of just naming them right on
the source code line. But, e.g.,
print << cmp(x, y), 10, 20, 30 # jump to 10 if x<y, etc
is plain ugly.
just-wait-until-p3k<wink>-ly y'rs - tim
More information about the Python-list
mailing list