Orphaned Response

karl at haddock karl at haddock
Sat Aug 16 07:53:00 AEST 1986


desint!geoff (Geoff Kuenning) writes:
>While all of this discussion is very interesting and is important to
>achieving a precise language definition, let us not forget that there
>is *no* reason to ever write this particular expression.

I already mentioned one: "(e1?e2:e3),e4".  For another, the types might be
unknown, if they are arguments in a macro; in this case I would want the
macro to work on void as well as valued expressions.

>[If-else] is better style anyway;  it makes use of a construct that
>people are much more used to, and it makes it clearer [what you are doing].

I won't argue that; though style is less important when you're writing a
macro.  Btw, I've been hacking at tail.c recently, and noticed that it has
an expression statement of the form "flag ? f1() : f2()", where f1() and
f2() are functions returning no value.  The compiler accepted it, because
they were (implicitly) declared int rather than void.

Karl W. Z. Heuer (ihnp4!ima!haddock!karl), The Walking Lint



More information about the Comp.lang.c mailing list