> -----Original Message-----
> From: Mark J. Reed [mailto:[EMAIL PROTECTED]
>
> On 2004-04-15 at 19:39:25, Austin Hastings wrote:
> > Of course you used for buffers that were not powers of 2. Had they
> > been powers of 2, you would have used & or &~. The fact that you
> > didn't use a power of 2 is pretty questionable. The dread Unix
> > wizards will no doubt have questions for you about this. :-)
>
> What are you talking about?  The biggest use of modulus is in
> implementing hashes and when you are implementing hashes you want the
> number of buckets to be a prime number, not a power of two.

I'm totally willing to agree with you, Mark.

So:

A) Do you code hashing algorithms so frequently that you need a special,
low-cost-of-access operator built in to the language to support it?

Or:

B) Could you give up % as an operator in exchange for using, say, infix:mod
or mod(n,d) in your hashing code, so that some operation (like hash access,
or iteration, or method calls, or some-as-yet-unspecified-thing) that
actually does occur on nearly every line of code could use the good
character?

=Austin

Reply via email to