Re: [sv-bc] [Fwd: Issues with IEEE 1364-2005]

From: Paul Graham <pgraham_at_.....>
Date: Thu Aug 10 2006 - 11:31:50 PDT
Just for comparison:

In Ada the "and" and "or" operators are not
short-circuiting.  However, Ada has special "and then" and
"or else" operators which are short-circuiting:

    if x /= 0 and then 1 / x < epsilon then ...

    if ptr = null or else ptr.field = invalid then ...

In VHDL the "and", "or", "nand", and "nor" operators are
specifically defined to be short-circuiting.

Paul

> I think Steven effectively makes the point I have tried to make in a
> couple of previous submissions to this discussion. If someone who has
> been involved with the standardization process incorrectly assumes that
> the Verilog `&&' and `||' operators are short-circuiting (as they are in
> C, C++, Perl, Unix shells, Vera, and every other language I can think of
> that uses these symbols for logical conjunction and disjunction), how do
> we expect a user of the language to understand that the short-circuit
> evaluation is optional, and to write their code to take account of this
> semantic ambiguity?
Received on Thu Aug 10 11:31:53 2006

This archive was generated by hypermail 2.1.8 : Thu Aug 10 2006 - 11:32:04 PDT