On Mon, Oct 17, 2016 at 8:39 PM, Sam Tobin-Hochstadt <sa...@cs.indiana.edu>
> I think the `integer->integer-bytes` function is probably what you want.
Thanks Sam, that does the trick.
On Mon, Oct 17, 2016 at 8:38 PM, David Storrs <david.sto...@gmail.com>
> > What is the best way to write binary data such that I have control of the
> > representation? Basically, I want the Racket equivalent of the Perl
> > and 'unpack' functions, where I can do: pack('C', 202) and get back a
> > one-byte binary representation of the decimal number 202 (or pack('s',
> > to get a 2-byte version) that I could then write to a port.
> > The reason that I'm looking for this is that I'm going to be writing
> > data across the network and I want to be able to control the
> > For a fairly trivial example, I want to be able to decide how many bytes
> > number 202 should take up. Furthermore, I'd like to have an easy
> way to
> > do quick and dirty testing; I thought that writing to a byte string
> would be
> > that way, but I'm not having much success with it, as I haven't figured
> > how to make things go in as raw bytes instead of strings.
> > I've looked at fasl, binary-class, the implementation of protobuf, and
> > everything in the racket-lang docs that I could think of keywords for,
> > no luck. This feels like it should be a straightforward task, so I'm
> > frustrated with myself for not figuring it out more quickly.
> >  I keep using the number 202 because that's the size of one particular
> > message that I'm using in my text script and I'm trying to do RLE on it.
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to racket-users+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
For more options, visit https://groups.google.com/d/optout.