Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!coplex!disk!corpane!herman From: herman@corpane.uucp (Harry Herman) Newsgroups: comp.sys.handhelds Subject: Re: What's the difference? Message-ID: <1991Jun28.223713.6352@corpane.uucp> Date: 28 Jun 91 22:37:13 GMT References: <1991Jun26.180439.6856@soph.cs.ubc.ca> Organization: Corpane Industries Inc. Lines: 34 In stevev@greylady.uoregon.edu (Steve VanDevender) writes: >>Consider the following fragment: >> # 80000000 h SRB SRB SRB # C0 h AND # 80 h SAME >>With word size > 32, the above evaluates to 1 (as expected). However, with >>word size = 32, the above evalutes to 0. Why is this the case? >I just tried this with word size == 64, and got a result of #80h >that was a 16-nibble binary integer. With word size == 32, the >result of #80h was an 8-nibble binary integer. They compare >unequal with SAME because they are not the same object. They do >compare the same with == because they do have the same value. >This is reminiscent of the difference between (eq foo bar) and >(equal foo bar) in LISP--eq compares the objects to see if they >are the same (reside at the same address) while equal compares >them to see if they evaluate to the same value. SAME compares >the binary representation of the objects while == compares their >visible values. >-- >Steve VanDevender stevev@greylady.uoregon.edu >"Bipedalism--an unrecognized disease affecting over 99% of the population. >Symptoms include lack of traffic sense, slow rate of travel, and the >classic, easily recognized behavior known as walking." However, the HP48 Programmer's Reference Manual states that SAME and == are supposed to work the same for any comparison that does not include algebraics or a name. (pgs 323 and 447). In fact SAME said it is "identical in effect to ==" except for those two types. Harry Herman herman@corpane