Date: Thu, 9 Nov 2000 18:32:31 -0800
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
Subject: Re: funny behavior
In-Reply-To: <firstname.lastname@example.org>; from
pete.lund@HOME.COM on Fri, Nov 10, 2000 at 01:40:31AM +0000
Content-Type: multipart/signed; micalg=pgp-sha1;
on Fri, Nov 10, 2000 at 01:40:31AM +0000, Pete Lund (pete.lund@HOME.COM) wrote:
> What you're really saying in your x1=x2=x3=x4=0 is:
> x1 = (x2=x3=x4=0)
> where "x2=x3=x4=0" is a logical expression that will return false (0).
> The expression is basically asking "are x2, x3, x4 and 0 all the
> same?" At this point, since x2-x4 have never been referenced, they
> are not 0 and so the expression is false.
Pete's explanation is probably clearer if we specify the equivalence
operator rather than the '=' sign, whose interpretation is overloaded in
...assigns to X the value of 'expression'.
y= ( x = epression );
...assigns to Y the value of 'X eq expression'.
For clarity, I prefer to write:
y = ( x eq expression );
Pete's illustration then becomes:
x1 = ( x2 eq x3 eq x4 eq 0 );
I for one would prefer that this distinction could be made an error test
in code -- use of '=' as an equality test rather than as an assignment
would produce an error condition. Much sloppy code exists which assumes
the incorrect behavior.
Karsten M. Self <email@example.com> http://www.netcom.com/~kmself
Evangelist, Zelerate, Inc. http://www.zelerate.org
What part of "Gestalt" don't you understand? There is no K5 cabal