SCOUG-Programming Mailing List Archives
Return to [ 07 |
August |
2003 ]
<< Previous Message <<
>> Next Message >>
Content Type: text/plain
On Thu, 7 Aug 2003, Lynn H. Maxson wrote:
> Imperative languages require that the programmer
> "physically" maintain the source in its "logical" order. The
> ordering (writing) and reordering (rewriting) remains a
> programmer responsibility.
As it should be. This is why your typical office worker prefers
spreadsheets over databases and programmers prefer real languages
over GW-BASIC... the ordering is implicit.
> The "a = b = c;", a statement valid in PL/I and not in C,
> represents operator overload. The first "=" is the assignment
> operator;the second, the logical operator. Now C gets cute by
> introducing "==" along with "&&" and "||". PL/I would be
> better off by dropping the "=" for assignment by using the
> APL left arrow ("<-") to make the statement read "a <- b =
> c;", i.e. replace the value of a with '1'b if b = c, otherwise '0'b.
>
> I don't want to confuse the C programmer reading this that in
> PL/I a, b, and c could be arrays (dcl (a, b, c) (20, 20, 20)
> bit(1):) and that "a = b = c;" remains valid. Or that even
> possibly you could reset all three to '0'b: "a, b, c = '0'b;". No
> sense in confusing him with the ability to have multiple
> lefthand variables, i.e. multiple assignments in a single
> statement. Let him enjoy the extra typing of C.
That would be written in C as "a = b = c = 0;" since '=' is just another
binary operator which returns the right-hand value. Agreed, '==' vs. '='
is a royal pain, and I'm used to typing '->' to dereference pointers, and
I'd only have to type '=' to test equality if I used '<-' for assignment.
I'll have to try that in my new compiler.
=====================================================
To unsubscribe from this list, send an email message
to "steward@scoug.com". In the body of the message,
put the command "unsubscribe scoug-programming".
For problems, contact the list owner at
"rollin@scoug.com".
=====================================================
<< Previous Message <<
>> Next Message >>
Return to [ 07 |
August |
2003 ]
The Southern California OS/2 User Group
P.O. Box 26904
Santa Ana, CA 92799-6904, USA
Copyright 2001 the Southern California OS/2 User Group. ALL RIGHTS
RESERVED.
SCOUG, Warp Expo West, and Warpfest are trademarks of the Southern California OS/2 User Group.
OS/2, Workplace Shell, and IBM are registered trademarks of International
Business Machines Corporation.
All other trademarks remain the property of their respective owners.
|