Re: What do we mean by "Identical" ?



newser.bbs@xxxxxxxxxxxxxxxxx writes:

> Harald , I sincerely wish you have good time during your riding in the
> warm breeze.
> I think there is misunderstanding between us. I am not a pedagog. In
> fact , I have confessed that I am new to lisp.
>
> I believe that you are right that the arguments should be evaluated
> before the calling of the function , but this still makes me more and
> more confused . What do you think makes "eq" different from "eql"?
> Following those procedures you taught me , I can't tell "eq" apart from
> "eql".
>
> Again , in "Practical Common Lisp" , Peter tells us that "expression
> (eq 3 3) can legally evaluate to either true or false" . Following your
> procedures , I'm too foolish to see why it is possible for (eq 3 3 ) to
> evaluate to false.

In my version of Lispworks, I can do this:

(eq 3 3)
=> T

(eq 1234567890 1234567890)
=> NIL

(eql 1234567890 1234567890)
=> T

What gives? EQ compares the bit patterns stored in the machine
registers. Small numbers like 3 fit in a register so the bits are the
same. Large numbers like 1234567890 are stored at some memory address
and there may be multiple copies. The bit patterns will have the
address of one of the copies and it may not match the other.

EQL special cases large numbers (and characters) so you don't have
this weird behavior. Otherwise they are the same.

.



Relevant Pages

  • Re: What do we mean by "Identical" ?
    ... Harald, I sincerely wish you have good time during your riding in the ... warm breeze. ... I think there is misunderstanding between us. ...
    (comp.lang.lisp)
  • Re: Date Tonight by Bicycle!
    ... I do rather like riding the tandem out for a date with my wife. ... be registers"; and there were registers. ... and DEC separated the data from the instructions. ...
    (rec.bicycles.misc)