[REBOL] Re: Bit-shift operators
From: greggirwin::mindspring::com at: 21-Feb-2006 6:50
FT> Are bit-shift operators available in REBOL, to shift (signed and
FT> unsigned) integers to the right or left ?
FT> More specifically, I am interested in getting the bytes of an
FT> integer (16 or 32 bits) in big-endian and low-endian order.
If you can use a test release that has the rebcode VM in it (see
REBOL.net for more info on that), there are bit ops in there, and you
can easily wrap mezzanines around them. If that doesn't work for you,
I have some old--and probably ugly--code here for twiddling bits with
pure REBOL, but it will be very slow by comparison.
If you don't need actual shift ops, you might be able to do it another
way. Check out this ML thread at REBOL.org to see another approach: