Article View: comp.std.c
Article #3594Re: Wishful thinking: return-parameter
From: Markus Freericks
Date: Tue, 01 Aug 1995 11:29
Date: Tue, 01 Aug 1995 11:29
27 lines
1471 bytes
1471 bytes
In article <3vjlmk$8co@caip.rutgers.edu> halasz@caip.rutgers.edu writes:
> In article <3viv5u$bkv@news.cs.tu-berlin.de>, mfx@cs.tu-berlin.de (Markus Freericks) writes
> > .....
> > My proposal: separate the concepts of return-value and return-control-flow,
> > and extend the function syntax to (for example)
> this is _the_ point ....
>
> > .....
> > return; /* return from foo with whatever has been assigned to x,y */
> > }
> And "return" no longer is _needed_.
Two words:
side effects
- what if you _want_ one or all results to be undefined?
- maybe you _want_ to store the result before doing a side effect without
having to resort to an auxiliary variable, as in
(int ret) get-locked-int () {
lock();
ret = thingie;
unlock();
return;
}
-- Markus
Technical Details
Message-ID:
<3vkvmm$rtt@news.cs.tu-berlin.de>Path:
arc1-ca.pugleaf.net!cs.tu-berlin.de!mfxReferences:
<3ver2u$8bk@caip.rutgers.edu> <3vg8l8$5sd@myst.plaza.ds.adp.com> <3viv5u$bkv@news.cs.tu-berlin.de> <3vjlmk$8co@caip.rutgers.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!cs.tu-berlin.de!mfx From: mfx@cs.tu-berlin.de (Markus Freericks) Newsgroups: comp.std.c Subject: Re: Wishful thinking: return-parameter Date: 01 Aug 1995 11:29:37 GMT Organization: TU Berlin Fachbereich Informatik Distribution: world Message-ID: <3vkvmm$rtt@news.cs.tu-berlin.de> References: <3ver2u$8bk@caip.rutgers.edu> <3vg8l8$5sd@myst.plaza.ds.adp.com> <3viv5u$bkv@news.cs.tu-berlin.de> <3vjlmk$8co@caip.rutgers.edu> NNTP-Posting-Host: lenin.cs.tu-berlin.de Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit In-reply-to: halasz@caip.rutgers.edu's message of 31 Jul 1995 23:32:52 MET