P
Pascal J. Bourguignon
Tim Bradshaw said:Yes, I know this & equivalent things can be done for Java of course,
or probably any language (I bet there were people who did
bit-twiddling in prolog). But that's still quite different than C
which is really designed for that kind of bit-twiddling (I mean,
historically, it really was designed for just that sort of thing).
Bits are bits.
Once you have bit operators, you can do bit twiddling as easily in any
language.
Actually, bit operations in Lisp are easier to write, and potentially
compiled more easily to more efficient code. dpb, ldb, ldb-test,
deposit-field, mask-field, integer-length, logand, logandc1, logandc2,
logeqv, logior, lognand, lognor, lognot, logorc1, logorc2, logxor
logbitp, logcount, logtest, ash, byte, are much richer bit manipulation
primitives than what is provided by C or most other programming
languages.