Article View: comp.std.c
Article #3631Re: Wishful thinking: return-parameter
From: Stephen Baynes
Date: Thu, 03 Aug 1995 07:13
Date: Thu, 03 Aug 1995 07:13
32 lines
2175 bytes
2175 bytes
Christopher R. Volpe (volpe@bart.crd.ge.com) wrote: : In article <3ver2u$8bk@caip.rutgers.edu>, halasz@caip.rutgers.edu writes: : >What with all this stuff propozed for new standard C, one thing I want : >to see, the return-parameter. A function is declared with a set of -snip- : >Fortran and Pascal s mistake was to name the return-parameter the same : >as the function, the basic idea is good. This means that we can free : >us of the "goto"ish "return". : What's the point? What does your proposal provide that can't be achieved by : simply appending "return l;" to the body of the function? What's the : justification for your comment "Indeed, it were better if it not"? : What "goto-ish return" are you talking about? If you dislike the practice of : having multiple return statements in your functions, just use a regular goto : to the end of the function. Any situation where this is necessary, it would : also be necessary under your scheme. Personally, I like the ability to : indicate to the person reading the code that we're exiting immediately from : the function right here, rather than making him search for a goto-label, or : adding obfuscating levels of conditional execution. I think you answer your own question. A goto-ish return is one that is equivalent to a goto to the end of the function. Note that in my understanding the proposal is not removing the return keyword - just removing the need for it in many cases. -- Stephen Baynes baynes@mulsoc2.serigate.philips.nl Philips Semiconductors Ltd Southampton My views are my own. United Kingdom
Technical Details
Message-ID:
<DCq42y.Jo2@ukpsshp1.serigate.philips.nl>Path:
arc1-ca.pugleaf.net!phcoms4.seri.philips.nl!panther!baynesReferences:
<3ver2u$8bk@caip.rutgers.edu> <DCnr0G.BD1@crdnns.crd.ge.com>Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c Path: arc1-ca.pugleaf.net!phcoms4.seri.philips.nl!panther!baynes From: baynes@ukpsshp1.serigate.philips.nl (Stephen Baynes) Subject: Re: Wishful thinking: return-parameter Sender: news@ukpsshp1.serigate.philips.nl (account for localnews) Message-ID: <DCq42y.Jo2@ukpsshp1.serigate.philips.nl> Date: Thu, 3 Aug 1995 07:13:46 GMT References: <3ver2u$8bk@caip.rutgers.edu> <DCnr0G.BD1@crdnns.crd.ge.com> Organization: Philips Semiconductors, Southampton, UK X-Newsreader: TIN [version 1.2 PL2]