在 Wed, 03 Jun 2009 10:58:32 +0800,Tim Matthews <[email protected]>
写道:
davidl wrote:
I mean the first behavior can cause problems.
Ohh sorry.
I doubt any coder would try to get that result by writing that piece of
code. I ported some C# source to D, and I got this semantic different
issue.
It is probably mostly used for dealing with binary data but D has no
other way of specifying a number that is only 1 byte except the char but
that would be a misuse of the type system unless ported from c/c++. Just
a few gotchas off the top of my head:
D C#
------------
ubyte Byte
byte SByte
wchar Char
Perhaps, it's because of my mistranslating all Byte to byte directly.
Nonetheless, the first behavior is not impressive. I innately dislike
that. Because I try to deal with a type with one byte by using Or
operator, I get it promoted to int. That implicitly cast sounds awful.
--
使用 Opera 革命性的电子邮件客户程序: http://www.opera.com/mail/