From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu Date: Wed, 2 May 2007 08:32:54 +0000 From: "Douglas A. Gwyn" Message-ID: <46378130.D670F815@null.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit References: <20070501144533.GA14908@ix.netcom.com>, <509071940705010851gab1931evde6f125f37c963f2@mail.gmail.com> Subject: Re: [9fans] speaking of kenc Topicbox-Message-UUID: 553f3bd2-ead2-11e9-9d60-3106f5b1d025 Anthony Sorace wrote: > i think that's the wrong question. i know plenty of people who believe > C suffers from its lack of a formal boolean type, but the correct > question for folks like standards bodies (and the peanut gallery here, > for whatever we matter) is whether adding it (in any particular form) > justifies the cost (in terms of added complexity, architectural > mismatch, monetary cost of implementation, or whatever criteria one > chooses) of adding it to the standard. How hard would it be to add the following to the directory where standard headers are kept? /* stdbool.h -- almost conforming implementation for pre-C99 environments */ #ifndef __bool_true_false_are_defined #define __bool_true_false_are_defined 1 /* program is allowed to contain its own definitions, so ... */ #undef bool #undef true #undef false #define bool int #define true 1 #define false 0 #endif /* !defined(__bool_true_false_are_defined) */ This provides 99% of the Boolean functionality that is actually used by C99-based applications without having to implement _Bool at all.