New package: bitwise-ops

A moment ago, I uploaded the 'bitwise-ops' package. It's a very small module that simply aliases the Racket bitwise functions to use the symbolic names from other languages.

<<   arithmetic-shift (i.e. left shift)
>>   arithmetic-shift, but negates the second argument (i.e. right shift)
&    bitwise-and
^    bitwise-xor
bor  bitwise-ior  (ordinarily |, but that's a special character for Racket's reader)
~    bitwise-not

1 Like
#lang racket
(define \| bitwise-ior)
(\| 13 7) ; ==> 15

If that is a good or bad idea is left as an exercise for the reader.

1 Like

I have seen / used in place of |.

Against that idea is that many read / as division.

1 Like