ternary operator
Alex Martelli
aleax at aleax.it
Tue Feb 11 08:12:49 EST 2003
John Roth wrote:
...
> Sigh. It's also wrong - whoever wrote the original didn't know COBOL!
> While I've forgotten the syntax, it has a fully functional case style
> construct (SELECT)?.
As I recall, SELECT associates filenames with datasets -- I don't
think that's the one you mean. Maybe EVALUATE, as in:
EVALUATE some-expression
WHEN 1 ...
WHEN 2 THROUGH 17 ...
WHEN OTHER ...
END-EVALUATE.
if my memory's not playing tricks. There's also some weird
form "EVALUATE this ALSO that ... WHEN 12 ALSO 23 ..." but
I don't think anybody would claim that's readable or clear...
and you could have expressions in the WHEN, I believe, not
just constants... I'd better stop before some real cobolist
starts laughing too hard, I only learned Cobol in a couple of
days because it was the only alternative to a horrid non
procedural thing called "cross-system product" that I could
use to help a local University make some mods to their
accounting system, and that was 15 years ago...!-)
Alex
More information about the Python-list
mailing list