libera/#sicl - IRC Chatlog
Search
13:30:37
moon-child
would anything go wrong if you defined fixnums to be those integers which are guaranteed to be eq if they are eql?
13:31:59
moon-child
while I think it would be a good idea to make eq consistent for bignums et seq, I do appreciate that there are some optimisations that would be broken by that. But I can't imagine a high-performance implementation strategy which would not be able to guarantee eq on fixnums is the same as eql without sacrificing anything
13:32:25
hayley
Would an implementation which heap allocates all integers and implements EQ by pointer comparison have no fixnums?
13:33:20
moon-child
I think a few things like array indices have to be fixnums. So if you heap allocate all integers, you take a performance hit on eq
13:33:37
moon-child
but you take a much larger performance hit by heap allocating all integers, so I don't think it matters
13:38:14
jackdaniel
if fixnum is allocated as an immediate type and eq is implemented as a pointer comparison, then it will be eq; it is just a matter of tying your hands by commiting that the implementation will always do that by specifying it in the manual
13:39:15
moon-child
the question is whether specifying it thus constrains implementations in any interesting ways
13:39:36
jcowan
Even in Lisps that don't have a formal rule about it, it is generally true that the limit on the size of an array is the size of a fixnum, simply because both tend to be closely related to the size of a machine word.