"Adrian Knoth" wrote in message news:slrnbnnohq.26h.adi@ppc201.mipool.uni-jena.de... > David N. Maez wrote: > > > x : integer; > > y : integer; > > x := x xor y; > > > What am I missing? > > There is no XOR defined for anything else than bits. You'll need > to mask the bits and recombine the result. > Not true. Ada 95 permits using XOR on modular types. If you want to XOR between integers, convert the integer to a modular type, do the XOR, then convert the result back. The following (tested) routine does exactly this. function "xor"(Left,Right : in Integer) return Integer is pragma inline("xor"); type Int_As_Mod is mod 2 ** Integer'size; function To_Mod is new Ada.Unchecked_Conversion( Integer, Int_As_Mod ); function To_Int is new Ada.Unchecked_Conversion( Int_As_Mod, Integer ); begin return To_Int( To_Mod(Left) XOR To_Mod(Right) ); end "xor"; Steve (The Duck) [excessively complicated untested example deleted] > -- > mail: adi@thur.de http://adi.thur.de PGP: v2-key via keyserver > > M�nner sind wie Jeans: blau und steif...