yank '>>>'?

Lionello Lunesu lio at lunesu.remove.com
Sun Dec 6 15:24:46 PST 2009


On 7-12-2009 0:11, Andrei Alexandrescu wrote:
> D has operator >>> which means "unsigned shift to the right", inherited
> from Java. But it doesn't need it because D has unsigned types, which
> can be used to effect unsigned shift. (Java, lacking unsigned types, had
> no other way around but to define a new operator.)
> 
> Should we yank operator>>>?
> 
> 
> Andrei

Ah!! Keep it, but let it mean "rotate right" and introduce <<< to mean
"rotate left"!

There's currently no rotate operator and the only way to do rotate is
either write unportable inline asm or do "(x<<s) | (x>>(sizeof(x)*8-s))"

OK, so people coming from Java *will* be surprised  :)

L.



More information about the Digitalmars-d mailing list