[net.lang.c] Min/max and bool

mike@whuxl.UUCP (BALDWIN) (05/28/86)

Re: new? min and max ops
>>>o Min and max operators.  These would get used all over the place.  These
>>>should be usable to the left of the assignment operator, as most but not all
>>>C operators are.

The PDP-11 C compiler had two operators /\ and \/ whose names in the compiler
had something to do with MAX and MIN, I believe.  Unfortunately, they weren't
really implemented -- they were parsed but that's as far as it got.

Re: builtin bool type
>I'm not sure why not.  Assuming all the implicit int/bool conversions stay,
>I think the only problems are (a) it isn't really necessary, and (b) it adds
>a new reserved word (breaking any programs that use "typedef int bool"!).

(a) is the biggie.  Why add bool when "typedef enum { FALSE, TRUE } bool;"
works fine?  (Relying on ANSI C's treatment of enums as real ints)
-- 
						Michael Baldwin
			(not the opinions of)	AT&T Bell Laboratories
						{at&t}!whuxl!mike

ron@brl-sem.ARPA (Ron Natalie <ron>) (06/01/86)

> (a) is the biggie.  Why add bool when "typedef enum { FALSE, TRUE } bool;"
> works fine?  (Relying on ANSI C's treatment of enums as real ints).

Because it wouldn't work.  FALSE=0, TRUE= anything else.

-Ron