From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <622b8580ff4fa7e12cb655bf19694fe8@vitanuova.com> To: 9fans@cse.psu.edu Subject: Re: [9fans] same functions everywhere From: rog@vitanuova.com In-Reply-To: <3EBB29D8.7030200@null.net> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Fri, 9 May 2003 14:21:25 +0100 Topicbox-Message-UUID: a5caeaee-eacb-11e9-9e20-41e7f4b1d025 DAGwyn@null.net: > when sizeof(char)== > sizeof(int) it is very likely that all-one bits is a valid > data value *as well as* the EOF marker don't most >8bit character encodings (including unicode) provide at least one code point to represent "not a character"? anyway, i'm not arguing about the design of getc. maybe it should have been int getc(FILE *f, char *c); filling in the character at c iff it returns 1. some of the plan 9 rune(2) functions work in this kind of way. however, i would argue that using exceptions for such a thing would be fairly unwieldy, and end up obfuscating what should be plain, straightforward code. exceptions are surprising things: they do not facilitate linear reading of the code; they should be kept for genuinely surprising conditions.