Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!mcsun!ukc!harrier.ukc.ac.uk!mtr From: mtr@ukc.ac.uk (M.T.Russell) Newsgroups: comp.lang.c Subject: Re: TRUE and FALSE Message-ID: <5409@harrier.ukc.ac.uk> Date: 5 Sep 90 11:21:06 GMT References: <5398@harrier.ukc.ac.uk> <3686@goanna.cs.rmit.oz.au> Reply-To: mtr@ukc.ac.uk (M.T.Russell) Organization: Computing Lab, University of Kent at Canterbury, UK. Lines: 27 In article <3686@goanna.cs.rmit.oz.au> ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) writes: >I have seen too many Pascal programs where people wrote > x: boolean; ... if x = TRUE then ... > ... I _have_ seen it in C code, and it was wrong. I don't want people who do that kind of thing hacking my code. If they get something as simple as this wrong then what hope is there of them getting anything else right? >Why should your proposed C variant be more restrictive than Pascal? >In Pascal FALSE < TRUE is allowed, meaningful, and true. I can't see any use for this, but I don't have any violent objection to it. I'd make a couple of changes to my scheme on reflection: I'd disallow assignment of 0 and 1 to bool variables, and make TRUE and FALSE keywords. I'd also turn on a macro __BOOL__ to indicate that the extension was there, so that applications could say: #ifndef __BOOL__ typedef int bool; #define TRUE 1 #define FALSE 0 #endif Mark