[fpc-pascal] rotating bits

Jonas Maebe jonas.maebe at elis.ugent.be
Fri May 26 17:43:16 CEST 2006


On 26 May 2006, at 16:36, Bisma Jayadi wrote:

> Agree! Since these are very important and relatively commonly used,  
> I think it'd be better if they're implemented as new operators  
> ("ror" and "rol") rather than as functions. Say we'll able to code  
> like this:
>
> a := b ror c;
> x := y rol z;
>
> Just what we have now with "shr" and "shl". I believe it won't  
> break any compatibility with Delphi code, even we have new  
> "feature" of FPC. :)
>
> What do you think?

It would wreck havoc with typing. What should the result be of "1 ror  
1"? $80? $8000? $80000000? $8000000000000000? $80000000 on 32 bit and  
$8000000000000000 on 64 bit cpus?


Jonas



More information about the fpc-pascal mailing list