Re: [racket] Low level manipulation on numbers

2011-10-11 Thread Doug Williams
Or the packed-binary package on PLaneT ( http://planet.racket-lang.org/display.ss?package=packed-binary.plt&owner=williams) that is useful for reading binary formatted files. From the package description: Performs conversions between Racket values and C structs represented as byte strings. It also

Re: [racket] Low level manipulation on numbers

2011-10-11 Thread Tony Garnock-Jones
Hi Nicolas, On 2011-10-08 12:41 PM, nicolas.o...@gmail.com wrote: > I am trying to write a small implementation of Protocol Buffers > ( http://code.google.com/p/protobuf/ ) and I have difficulties > with bit manipulations, especially to transform a negative integer into > a series of bytes and

Re: [racket] Low level manipulation on numbers

2011-10-08 Thread nicolas.o...@gmail.com
Thank you so much for your very quick answer. It seems that the conversion to and from bytes are what I was looking for. With that, it is quite easy to do all the manipulations I want. Best, Nicolas. On Sat, Oct 8, 2011 at 6:57 PM, Matthew Flatt wrote: > At Sat, 8 Oct 2011 17:41:35 +0100, "ni

Re: [racket] Low level manipulation on numbers

2011-10-08 Thread Matthew Flatt
At Sat, 8 Oct 2011 17:41:35 +0100, "nicolas.o...@gmail.com" wrote: > I am trying to write a small implementation of Protocol Buffers ( > http://code.google.com/p/protobuf/ ) and I have difficulties > with bit manipulations, especially to transform a negative integer into a > series of bytes and ba

[racket] Low level manipulation on numbers

2011-10-08 Thread nicolas.o...@gmail.com
Dear all, I am trying to write a small implementation of Protocol Buffers ( http://code.google.com/p/protobuf/ ) and I have difficulties with bit manipulations, especially to transform a negative integer into a series of bytes and back. I can not find an implementation of a non-arithmetic shift