> Those numbers look like pointers interpreted as fixnums
Yes.
The optimizer thought that the result of (bitwise-and num -2) was a
fixnum, so it changed
(bitwise-ior (bitwise-and num -2) 0)
to
(unsafe-fxior (bitwise-and num -2) 0)
All the pointers are even (actually a multiple of 4 in 32 bits and a
multiple of 8 in 64 bits). Fixnum are implemented as "pointers" to an
odd address, the fixnum n is encoded as 2*n+1.
I.E. If the "pointer" is even then it's a pointer to a real object. If
the "pointer" is odd then it's a fixnum.
In this case, the result of (bitwise-and num -2) was a pointer to a
bignum, but unsafe-fxior interpreted it as fixnum without checking the
parity, so what you see is the address of the bignum divided by 2.
Each iteration produces a new bignum, so you will usually get results
in an increasing order, as the allocator creates new objects.
Gustavo
> To view this discussion on the web visit
https://groups.google.com/d/msgid/racket-dev/m2d1j3yuj4.wl-stamourv%40eecs.northwestern.edu.