Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Aug 2001 20:15:06 +0200
From:      Raymond Wiker <Raymond.Wiker@fast.no>
To:        les@safety.net
Cc:        europax@home.com (Rob), hackers@FreeBSD.ORG (hackers@FreeBSD.ORG)
Subject:   Re: the =+ operator
Message-ID:  <15220.9386.441669.962830@raw.grenland.fast.no>
In-Reply-To: <200108101446.HAA99867@safety.net>
References:  <3B73F0BC.548D40B3@home.com> <200108101446.HAA99867@safety.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Les Biffle writes:
 > > My first post on hackers, so please don't flame me too bad :)  I think
 > > that only an old hacker can give me the answer :)
 > > 
 > > I've searched far and wide on search engines to find out what the =+
 > > operator does, to no avail.  I'm porting some old code and found it.
 > 
 > I ran into this a couple of times, and it was always a typo by the
 > programmer.  Whether they meant to use "+=" or not wasn't always
 > clear.  In C, you should imagine reading the code with all of the
 > non-quoted white space removed to see how the compiler will treat
 > something, so "a =+ 1;"  is the same as "a=+1;" or "a = +1;"  There
 > has never been an operator =+, even checking back to the BCPL days.
 > 
 > So, read the code carefully to see if you can figure out if they
 > meant +=

	This is actually wrong - the += and -= operators were
originally written as =+ and =-. This is obviously ambiguous, given
the fact that whitespace is ignored.

	//Raymond.

-- 
Raymond Wiker
Raymond.Wiker@fast.no

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15220.9386.441669.962830>