[700] in Coldmud discussion meeting
Re: assignment operator
daemon@ATHENA.MIT.EDU (Fri Mar 10 23:58:33 1995
)
Date: Fri, 10 Mar 1995 20:54:57 -0800
To: coldstuff@MIT.EDU
From: jeffpk@netcom.com (Jeff Kesselman)
>-> A solution I haven't seen tried is to use '=' for >both<
> assignment and comparison, and to keep the contexts in
> which they are allowed mutually exclusive. This
> wouldn't be impractical, I don't think, although Cfolk
> might dislike the restriction. I doubt novice hackers
> would.
The only problem with this is its confusing for competent C programmers who
often write code like this:
if (!fptr=fopen(...))
This, ofcoruse, executes the body if andonly if fopen() returns NULL.
I would advise STRONGLY people consider the following rules of
compatability to keep ColdC useable and acceptable to the largest number of
people:
1) Where a functionality is identical to C, use C syntax.
2) Where a functionality is DIFFERENT from C, use different syntax to flag it.
3) NEVER EVER introduce syntax that can look like valid C syntax but do
something different.
Speaking of which, the switch() statement already breaks (3). It acts more
liek a pascal/Modula2 CASE statetment. This IMo shoudl be fixed or the
synatx should be chanegd to reflect that (change t Pascal syntax woudl be
my suggestion.)
JK