> -----Original Message----- > From: Jonathan Scott Duff [mailto:[EMAIL PROTECTED] > > On Thu, Apr 15, 2004 at 06:38:34PM -0400, Austin Hastings wrote: > > The use of % as a modulo operator is purely a legacy from 'C', > > where it was a failure: in 'C', the only number you care about > > for modulus is some power of 2, and you get those using > > bitwise-and anyway. > > I disagree with this completely. I've used % plenty of times in C > for circular buffers that were not a powers of 2. % as modulus in C > is NOT a failure.
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. :-) My point, though, is this: a *lot* of the stuff we take for granted, or did until Larry started shining a light on things like &, |, ?:, etc., has crappy Huffman coding. Even something like semicolon as statement terminator isn't what it should be. Instead, it's a nod in the direction of COBOL, where everything was to be an english-like sentence, so ended with period. Sadly, there's exactly one statement terminator per statement, but there's a lot of characters that appear more frequently, like parens and braces. One solution is to eliminate the parens, as with the p6 changes for if and while. A better solution would be to either improve the finger-movement count for those characters, or reuse the "purer" characters for better purposes. Thus, period as a method delimiter is palatable since it replaces -> (dash, shift, dot). The only thing really fighting against pure-Huffman is the preconceived ideas that eurocentric coders have about symbology: +, -, *, and to a lesser extent / "mean" things. Otherwise, / would be a good candidate for re-use: unshifted, prime real estate, has certain separator-like qualities. If you think about it, what we really ought to do is train ourselves to "reverse" the numbers row on our keyboards. If we're doing a good job about avoiding magic numbers, then " $ % & ( ) are going to be much more frequently used than 2 4 5 7 9 0, so why don't we "fix" them by swapping the shifted for unshifted characters? > > If there is no comma-optional case, then you might even say: > > > > $foo % bar > > $foo % $bar > > > > @foo @ 10 % bar (for some reason, I can't like @ as an array > > dereference. [] does it for me.) > > I'd favor Juerd's proposal over this madness any day :) Oh! The slings and arrows of public discussion. I bleed! I die! Aaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa rgh. [Aside] Though this be madness, yet there is method in't. ;-) =Austin