Don wrote:
Tom,
good question, and we could also ask why people insist on developing new
programming languages/environments versus improving what we already
have... Frankly, I've yet to see anything done in a current language that
couldn't have been incorporated in good ole PL/I..... :) :)
Oh well........
Ahhh! "good ole PL/I"! A truly marvellous language, developed before
computer scientists had any decent understanding of what's really needed
in a programming language. But before Pascal, and before C, PL/I had
everything already. Things like structured programming and user defined
types. Its problem was that it had *too* much. The designerS of PL/I
looked at the programming languages in common use in the mid 1960's. But
instead of selecting a sufficient subset of available language features,
they tossed all known language concepts into a bowl, stirred it up, and
called the resulting conglomeration "PL/I". We've come a long way since
then! ;-)
Back on topic, if you think coding:
if a>b;
res = foo;
else;
res = bar;
endif;
is too much work, you could shorten it by assigning values to an array
and indexing into it:
arr(1) = foo;
arr(2) = bar;
res = arr(%int(a>b)+1);
Alternatively, you could define your own "ternary" procedure, and call
it like:
res = ternary(a>b: foo: bar);
But these alternatives are still not quite like the "ternary" operator
of a couple of other languages since both result expressions are evaluated.
BTW, this reminds me of a long debate in the Python community, where no
one could agree either on the syntax for a "ternary" operator, or the
very need for one. And so a decision was made by the BDFL to not bother
adding it to the language.
Cheers! Hans
This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.