Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!pasteur!agate!ucbvax!SW.MCC.COM!wex From: wex@SW.MCC.COM (Alan Wexelblat) Newsgroups: comp.lang.modula2 Subject: CONVERT, and the meaning of "meaning" Message-ID: <8807141340.AA23464@banzai-inst.sw.mcc.com> Date: 14 Jul 88 13:40:17 GMT References: <507@ethz.UUCP> Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: Info-Modula2 Distribution ListOrganization: The Internet Lines: 26 I said: >I hope we're not going the way of C which thinks it's acceptable to give "an >exception" (core dump) every time some poor programmer passes NULL to >strlen()! Gernot Heiser replied: > If every program bug would immediately force a program dump debugging > would be a piece of cake. But I know, some people like to debug... I don't think that's the right philosophy to program into support-library routines. In most cases, I intended to pass a null string; if I use the C constant NULL, I get a core-dump. If I use a literal null string ("") I get what I wanted, which was a length of zero. This is more a 'religion' argument but it relates back to the original point of what to do when type-converting routines get a value that's outside the range of defined values for the target type. My opinion is that these routines should return an out-of-band signal which the programmer could then test for. Core dumping or other uncatchable program exception is, in my opinion, a *very* poor way of handling errors. --Alan Wexelblat ARPA: WEX@MCC.COM UUCP: {harvard, gatech, pyramid, &c.}!sally!im4u!milano!wex "How do we measure the distance between Ken Kesey and Carlos Lehder?" -- Hunter Thompson