2 ms·
Is there an easy way to shuffle bytes and bits in Scheme? I was quite delighted when I found Data.Binary (http://code.haskell.org/binary/ http://code.haskell.o
by eru 17y ago
Is there an easy way to shuffle bytes and bits in Scheme? I was quite delighted when I found Data.Binary (http://code.haskell.org/binary/ http://code.haskell.org/binary/) for Haskell.
- alaricsp 17y agoYes... sort of. SRFI-4 (http://srfi.schemers.org/srfi-4/srfi-4.html http://srfi.schemers.org/srfi-4/srfi-4.html) provides a standard interface for dealing with 'homogenous vectors' (eg, arrays of unboxed integers or floats), which is great for shuffling bytes. For bits, there's the usual bitwise-or and all that. However, both could be improved somewhat; what the Factor folks have done with their struct arrays is IMHO superier.