RosettaCodeData/Task/Bitwise-operations/Objeck/bitwise-operations.objeck

18 lines
533 B
Plaintext

use IO;
bundle Default {
class Test {
function : Main(args : String[]) ~ Nil {
BitWise(3, 4);
}
function : BitWise(a : Int, b : Int) ~ Nil {
Console->GetInstance()->Print("a and b: ")->PrintLine(a and b);
Console->GetInstance()->Print("a or b: ")->PrintLine(a or b);
Console->GetInstance()->Print("a xor b: ")->PrintLine(a xor b);
# shift left & right are supported by the compiler and VM but not
# exposed to end-users; those instructions are used for optimizations
}
}
}