Re: Why multiplication not allowed?
From: Lew Pitcher (Lew.Pitcher_at_td.com)
Date: 01/07/04
- Next message: August Derleth: "Re: Why multiplication not allowed?"
- Previous message: Sensorflo: "avoid constant conditional expression warning"
- In reply to: Sean Kenwrick: "Re: Why multiplication not allowed?"
- Next in thread: CBFalconer: "Re: Why multiplication not allowed?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 07 Jan 2004 09:14:35 -0500
Sean Kenwrick wrote:
[snip]
> But I think the reason I didn't get the job was because one of the other
> questions the interviewer asked me was to tell him what was wrong with the
> following statement:
>
> i=+i;
>
> I said that there was nothing wrong with it, but the interviewer claimed
> that it was an ambiguous statement because it could mean adding i to itselt
> or setting i to +i. I got into an argument with him saying that he must
> be confused with i+=i; but he was adament he was right and got annoyed that
> I was disagreeing wih him.
>
> Afterwards I wondered whether this might have been some kind of syntax left
> over from a very early incarnation of C which was subsequently dropped.
> Perhaps the members of this group could enlighten me about this since I
> think that this guy was just a complete idiot.
ISTR an article by one of the original C developers (Dennis Ritchie or
perhap PJ Plauger) commenting on the /very/ early syntax of C. Specifically,
the article said that the syntax
i =+ j;
had been considered as a way to express
i = i + j;
but was ultimately rejected because it was ambigious, and could be confused with
i = j;
If I read http://cm.bell-labs.com/cm/cs/who/dmr/chist.html correctly, it
looks like this ambigious syntax was adopted from B into the earliest of C
compilers, but later dropped (in 1976) before the adoption of "K&R C".
[snip]
-- Lew Pitcher, IT Consultant, Application Architecture Enterprise Technology Solutions, TD Bank Financial Group (Opinions expressed here are my own, not my employer's)
- Next message: August Derleth: "Re: Why multiplication not allowed?"
- Previous message: Sensorflo: "avoid constant conditional expression warning"
- In reply to: Sean Kenwrick: "Re: Why multiplication not allowed?"
- Next in thread: CBFalconer: "Re: Why multiplication not allowed?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|