From owner-freebsd-questions Tue May 15 20:40:33 2001 Delivered-To: freebsd-questions@freebsd.org Received: from nisser.com (c0039.upc-c.chello.nl [212.187.0.39]) by hub.freebsd.org (Postfix) with ESMTP id 654AA37B423 for ; Tue, 15 May 2001 20:40:27 -0700 (PDT) (envelope-from roelof@nisser.com) Received: from nisser.com (roelof [10.0.0.2]) by nisser.com (8.9.3/8.9.2) with ESMTP id FAA99400; Wed, 16 May 2001 05:39:02 +0200 (CEST) (envelope-from roelof@nisser.com) Message-ID: <3B01F656.8FF2B626@nisser.com> Date: Wed, 16 May 2001 05:39:02 +0200 From: Roelof Osinga Organization: eBOA - Programming the Web X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en,pdf MIME-Version: 1.0 To: Greg Lehey Cc: Garance A Drosihn , j mckitrick , freebsd-questions@FreeBSD.ORG Subject: Re: return(value) or return value? (was: style(9) question) References: <20010515184940.A56109@dogma.freebsd-uk.eu.org> <20010516112824.B35292@wantadilla.lemis.com> <3B01EE40.4D2D6534@nisser.com> <20010516124259.B83152@wantadilla.lemis.com> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Greg Lehey wrote: > > >>> Apparently, some very early versions of C required this. > >> > >> Specifically, versions before about 1973. > > Brian W. Kernighan and Dennis M. Ritchie, The C Programming Language > > 1978 (!) published by Prentice Hall Software Series. > > I don't know what you're trying to say here. By the time this book > was written, the parentheses were no longer required. I would've though that to be self evident. That the creators of the language said in their book published in 1978 - thus five years later then the date you mentioned - to use the () expression in return. > This appears to be an error. In Appendix A, which is definitive, on > page 203, it states: Appendix A I quoted in the later parts of my message. > return ; > return expression ; Let's skip the analysation of this, you're right in the end and I know it. > I asked Dennis Ritchie about this some time back. Here's the reply: > ... > > An archaism: just so. The language and compiler ca. 1973 > > did want the parens. By the 5th edition (1975) I had realized that > > they weren't needed and the syntax was just 'return expression'. To bad they failed to mention that in they're 1978 book. > > > > On the other hand, no one seemed to want to make use of the > > new freedom. I glanced at v7 source (1977) and couldn't > > find any instances of non-parenthesized return values-- > > I might have missed an instance, but there couldn't have > > been more than a very few. Evidently it had become wired > > into the mental syntax. > > > > This was certainly true for Brian in K&R 1 and evidently > > for me as well, since the very few examples in the appendix > > use the (). But the grammar does indeed reflect the > > fact that they weren't required. Like I said, my later quotations in my message were from that very same appendix. Furthermore I wasn't taking it all to seriously as indicated by my saying that they - Dennis, it seems to've been - did a good job in turning up the obfuscation level. IOW I tuned out. I saw your message stating '73, so I thought, Ok let's check. Grabbed K&R 1.0, noticed it was published in '78 yet still mentioned using "return ();". So I missed in the quick of it some fine points of syntax. Like Denis put it, "What's in a name?". To which I would like to add "That an expression in any other semantics would compute as sweet!". Roelof PS do note that I was not actually disagreeing with you, barring on the point of the date supported by K&R 1.0. Do also note Dennis' few examples versus grammer. Nonetheless, you were indeed - and as usual - right and I was proofed - as usual ;) - wrong. -- _______________________________________________________________________ eBOAź est. 1982 http://eBOA.com/ tel. +31-58-2123014 mailto:info@eBOA.com?subject=Information_request fax. +31-58-2160293 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message