>Programmers who invoke operations with side-effects in such a context deserve >any surprises they may get :-) On the contrary, users deserve to get what they've always got. Legacy code is indeed a legacy, and we can't afford to squander it. Expert hardware designers are not necessarily expert C programmers. I'm a programmer, not a hardware designer. Yet even I prefer a parallel, functional style of programming that is easy to reason about, and I find C's sequentializing, left-to-right bias weird and unnecessary. What's the big advantage of being able to write if (guard && side_effector) instead of the more transparent if (guard) if (side_effector) ? To me, it would make more sense to say that a side-effecting expression shall not be the operand of an && or ||. -- Brad -----Original Message----- From: owner-sv-bc@eda-stds.org [mailto:owner-sv-bc@eda-stds.org] On Behalf Of Jonathan Bromley Sent: Saturday, August 12, 2006 2:03 AM To: sv-bc@eda.org Subject: RE: [sv-bc] [Fwd: Issues with IEEE 1364-2005] > Greg Jaxon pointed out to me that it would be more natural to define > > A ? B --> A ? B : '0 > > A ?: B --> A ? '1 : B That's pretty, but very scary to me: I can all too easily imagine people writing Y = A ? B; and wrongly assume that they're getting if (A) Y = B; I agree with Doug Warmke that, given the lack of prior definition, it's hard to see what's bad about mandating short-circuit semantics for && and ||. Programmers who invoke operations with side-effects in such a context deserve any surprises they may get :-) -- Jonathan Bromley, Consultant DOULOS - Developing Design Know-how VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, Hampshire, BH24 1AW, UK Tel: +44 (0)1425 471223 Email: jonathan.bromley@doulos.com Fax: +44 (0)1425 471573 Web: http://www.doulos.com The contents of this message may contain personal views which are not the views of Doulos Ltd., unless specifically stated.Received on Sat Aug 12 10:41:09 2006
This archive was generated by hypermail 2.1.8 : Sat Aug 12 2006 - 10:41:23 PDT