On 10/18/2016 12:27 AM, David Storrs wrote:
> On Mon, Oct 17, 2016 at 8:39 PM, Sam Tobin-Hochstadt
> <sa...@cs.indiana.edu <mailto:sa...@cs.indiana.edu>> wrote:
>     I think the `integer->integer-bytes` function is probably what you want.
> Thanks Sam, that does the trick. 

You might also find the `bitsyntax` package useful:

Here's a snippet from an ELF image writer:

  (bit-string ((hash-ref strtab-index name) :: little-endian bits 32)
              ((symbol-scope->number scope) :: little-endian bits 4)
              ((symbol-type->number type) :: little-endian bits 4)
              (0 :: little-endian bits 8) ;; st_other, reserved
              ((section->number section) :: little-endian bits 16)
              (value :: little-endian bits 64)
              (size :: little-endian bits 64))

(There's `bit-string-case` for taking binary blobs apart, too.)


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.

Reply via email to