[racket-dev] Bitwise operators

2012-06-19 Thread Harry Spier
1. Because of the length of the bitwise operators:
bitwise-and
bitwise-ior
bitwise-xor
bitwise-not

it might be useful for readability in even slightly complicated bit
manipulations to have something like the usual mathematical symbols
as aliases for these operations.

2. Why the names arithmetic-shift and integer-length instead of
bitwise-shift and bitwise-length ?

Thanks,
Harry Spier
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] Bitwise operators

2012-06-27 Thread Asumu Takikawa
On 2012-06-19 17:54:48 -0400, Harry Spier wrote:
> 2. Why the names arithmetic-shift and integer-length instead of
> bitwise-shift and bitwise-length ?

Late reply, but here's a reason: SRFI-33[1] and SRFI-60[2] already use
these names. Although it looks like Racket's `arithmetic-shift` name
predates SRFI-33 (and was more or less tradition among Schemes). It also
differentiates from a `logical-shift`, should one ever be defined.

Apparently `integer-length` was also the traditional name by the time
the SRFIs rolled around.

[1]: http://srfi.schemers.org/srfi-33/srfi-33.txt
[2]: http://srfi.schemers.org/srfi-60/srfi-60.html

Cheers,
Asumu
_
  Racket Developers list:
  http://lists.racket-lang.org/dev