J
Juan Gabriel Del Cid
There is no operator overloading in VB.
-JG
-JG
compatible with VB.NET in the first place, or I would have to make an object
out of this and do everything by means of methods, which is not very
.NETish.
Shawn B. said:Greetings,
Thanks for helping me with some of the C# bit manipulation issues I've asked
about over the last couple days. I've got a first public preview of the
Binary8, Binary16, Binary32, and Binary64 classes I've worked on.
http://www.visualassembler.com/binary/
Use it like you would any other int, short, byte, whatever... I've
overloaded all but one of the operators (^ -- don't know how to do so).
Examples,
Binary8 bin = "10110100";
Binary16 bin = "1101";
Binary8 bin2 = bin << 3;
Binary64 bin3 = "10101";
Binary8 bin4 = bin3; // accepable because it doesn't exceed 8 bits
Binary8 bin = 0xFF;
Binary16 bin2 = ~bin;
if (bin > bin2) {
bin >>= 7;
}
bin2 = bin.RoateLeft(3);
if (bin2 != bin) {
bin2 = bin;
}
bin++;
bin *= "0101";
you get the picture...
optimizations wanted. There will be more updates, this is just a preview...
Thanks,
Shawn
One of the biggest marketing pushes for .NET is that if you
write in one language, they are compatible with other languages
that target .NET. All you have to do is create you're own type
with an operator and all of the sudden, you're not compatible
with other languages that target .NET. I can understand that
VB.NET doesn't support operator overloading in its syntax, but
if I overload in MC++ or in C#, I would expect any other
language to be able to use that object, regardless whether it
supports a syntax for overloading its own operator. Good thing
this project isn't designed to be compatible with VB.NET in the
first place, or I would have to make an object out of this and
do everything by means of methods, which is not very .NETish.
So it seems only the intrinsic, int, long, bool, etc. are
supported by VB.NET in terms of using operators on them, and all
non-MS objects are not supported by VB?