🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #293

Re: Multiple Return Values From Functions (was Re: Language Tenets)

#293
From: Dave Till
Date: Tue, 18 Jul 1989 18:23
27 lines
1886 bytes
In article <8271@boring.cwi.nl> dik@cwi.nl (Dik T. Winter) writes:
>In article <15141@watdragon.waterloo.edu> I wrote:
> > I think it would be more elegant to allow the returning of multiple
> > values, as in
> > 
> > 	[quotient,remainder] = divrem(top,bottom);
> > 
>Change this to:
>	[quotient,remainder]:= divrem[top,bottom];
>and you have Mesa, Xerocs language.

It may be splitting hairs, but I claim that in Mesa procedures return
records, not multiple values.  Inside a Mesa procedure, the fields
of the result record can be accessed as if they were local variables;
furthermore, outside the procedure,
the components of the result record can be assigned
using the extraction operation.  Thus, it *looks* like Mesa procedures are
returning multiple values, when in fact they're not.

Disclaimer:  the book I'm referencing documents Mesa version 5.0, which
is dated April 1979.  Are there newer versions of Mesa, and if so, do
they feature multiple return values?  Enquiring minds want to know! :-)
--
--Dave Till, Computer Science Department, University of Waterloo
(dwtill@watyew.waterloo.edu)  ...<known universe>!watmath!watyew!dwtill
"Bottle, say after me, I must learn the difference between a lion and
a spider." -- Eccles to Bluebottle, the Goon Show, "Ned's Atomic Dustbin"
Technical Details
Message-ID: <15224@watdragon.waterloo.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!watdragon!watyew!dwtill
References: <1207@quintus.UUCP> <15141@watdragon.waterloo.edu> <8271@boring.cwi.nl>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!watdragon!watyew!dwtill
From: dwtill@watyew.waterloo.edu (Dave Till)
Newsgroups: comp.lang.misc
Subject: Re: Multiple Return Values From Functions (was Re: Language Tenets)
Keywords: multiple-valued expressions, function parameter lists
Message-ID: <15224@watdragon.waterloo.edu>
Date: 18 Jul 89 18:23:45 GMT
References: <1207@quintus.UUCP> <15141@watdragon.waterloo.edu> <8271@boring.cwi.nl>
Sender: daemon@watdragon.waterloo.edu
Reply-To: dwtill@watyew.waterloo.edu (Dave Till)
Organization: piles and piles of papers
Lines: 27