[racket] Best typed/racket representation for bitfield of width 125?

From: John Clements (johnbclements at gmail.com)
Date: Thu Sep 4 13:45:48 EDT 2014

I want to represent a bitfield of 125 bits, using typed racket. I’ll be
combining them using bitwise operations, and checking for zero-ness. I
think that’s about it.

I could just use type Integer, but it seems like that would impose
additional checking, since the type system doesn’t know the size.  In
untyped racket I used a vector of four integers in the range 0-2^32, but
those don’t fit in typed Racket’s “Fixnum” because it uses a signed
representation (and indeed, untyped racket may have been falling prey to
the same problem. Perhaps I should break it up into four integers in the
range 0-2^31? That seems weird, but maybe that’s my best choice? Or… I
could use a byte string.

Apologies if I’m missing something in the docs, here; I’ve spent a few
minutes searching, without turning anything up.

Thanks for any advice,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140904/152fe003/attachment.html>

Posted on the users mailing list.