|
From: | Paul Eggert |
Subject: | Re: hash-consing bignums and eq==eql |
Date: | Wed, 29 Aug 2018 12:31:11 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
Pip Cet wrote:
Okay, that's complicated. Five options, in my order of preference: 1. Slow EQ 2. float immediates, hash-cons the remaining floats, hash-cons bignums 3. hash-cons bignums, leave floats alone 4. hash-cons bignums and all floats 5. the status quo
Another possibility: * float immediates, no hash-consingThis keeps 'eq' fast, and causes eq to start to "work" on floats whose bottom few bits are zero.
the distinction between eq and eql for integers leads to subtle bugs that are best excluded by design, IMHO.
Common Lisp and Scheme both have this distinction, and they seem to be doing OK. In this particular tradeoff between performance and nicer behavior, most Lisp users seem to prefer performance.
[Prev in Thread] | Current Thread | [Next in Thread] |