PLEX86  x86- Virtual Machine (VM) Program
 CVS  |  Mailing List  |  Download  |  Newsgroups

Where should the type information be 141


Your Ad Here

Your Ad Here

On Wed, 30 Mar 2005 22:53:54 -0700, Steve

Well, yes, they are different, and do different things. The first is a conditional operator, much like an if() that returns a result, the second is a bit-wise binary logic operator. Both take integer expressions as arguments, and return integer results.

Where should the type information be 142
Until a critical number of people get the gear and are allowed to play with it to see what kinds of things it can be used for, we won't...

The compiler can't tell what your intent is. It can only check types and syntax. Admittedly, some compilers are growing warnings that also know about certain idiomatic uses, and complain about other forms. This sort of thing is sometimes useful, but often just annoying.

How so? A compiler that created a new "boolean" type to be the result of comparison operators, and which restricted combinations of this type with other integers wouln't be able to call itself C, and so it wouldn't matter.

Why would you expect there to be a speed difference, though, one way or the other?

I think so, given the way you've been using the terms. Obviously, you use bit-wise operators to perform bit-wise operations, and logical operators to evaluate conditions.

Examples? I think that you're calling && and the boolean operators? These are very well defined, as far as I know. What's a bit-wise logical operand? Some random integer? Where does the unpredictability come from?

I'll admit that there's not a lot that can be done, that way around, since the standard doesn't specify which non-zero value is produced (?) I haven't checked a standard recently, and can't remember ever seeing such a construct used. Is it really unspecified, or are they defined to produce 0 and 1? I imagine that there could be some hardware that naturally produces something like 0 and -1, in deference to other languages like Basic or Forth, but I haven't met one. There aren't very many processors that produce "values" for comparison results at all. Most have to do the machine-code equivalent of ((cond) ? 1 : 0) in order to produce an actual result value. Fortunately, this is hardly ever necessary.

How about the programmers take a few minutes to learn the language? They're not really very similar operators at all.

Where should the type information be 143
On Thu, 07 Apr 05 11:54:40 GMT Heisenberg rules :) But seriously - it's a given that more uses get found for computers than anyone would ever dream of while designing the things...
Where should the type information be 145
Stephen, et al, I may have misled people a bit when I pointed out that the precedence tables in C were wrong (which they are). The...

I don't think that the problem that you're describing is significant, in practice.

-- Andrew



Your Ad Here

List | Previous | Next

Where should the type information be 142

Alt Folklore Computers from Newsgroups

The #1 Usenet Provider on the Internet

Where should the type information be 140