[Larceny-users] error peeking short values from raw memory

Marco Maggi marco.maggi-ipsu at poste.it
Fri Jul 3 14:28:28 EDT 2009


"Felix Klock" wrote:
> Why  are   you  subtracting   2  here  when   you've  been
> subtracting 1 in all the other cases?

The form producing buggy output is:

> (let ((v (- (expt 2 15) 1)))
>  (%poke16 a v)
>  (write (list v (%peek16 a)))
>  (newline))

which prints (32767 -32769)  where I expected (32767 32767).
This one:

> (let ((v (- (expt 2 15) 2)))
>  (%poke16 a v)
>  (write (list v (%peek16 a)))
>  (newline))

correctly prints  (32766 32766), I included it  to show that
the problem is only with 2^15-1.
--
Marco Maggi



More information about the Larceny-users mailing list