Re: Multiple return values

gscase@interact.net.au (Sean Case)
4 May 1997 22:06:51 -0400

          From comp.compilers

Related articles
[17 earlier articles]
Re: Multiple return values jashley@eecs.ukans.edu (Mike Ashley) (1997-04-22)
Re: Multiple return values burley@tweedledumb.cygnus.com (Craig Burley) (1997-04-22)
Re: Multiple return values albaugh@agames.com (1997-04-22)
Re: Multiple return values tiggr@es.ele.tue.nl (1997-04-30)
Re: Multiple return values jch@hazel.pwd.hp.com (John Haxby) (1997-05-04)
Re: Multiple return values jan@digicomp.com (Jan Galkowski) (1997-05-04)
Re: Multiple return values gscase@interact.net.au (1997-05-04)
Re: Multiple return values Robert.Harley@inria.fr (1997-05-04)
Re: Multiple return values tim@franck.Princeton.EDU (1997-05-04)
Re: Multiple return values jens.hansson@mailbox.swipnet.se (1997-05-04)
Re: Multiple return values jamesl@netcom.com (1997-05-08)
Re: Multiple return values hbaker@netcom.com (1997-05-08)
Re: Multiple return values mark@omnifest.uwm.edu (1997-05-13)
[6 later articles]
| List of all articles for this month |

From: gscase@interact.net.au (Sean Case)
Newsgroups: comp.compilers,comp.lang.misc
Date: 4 May 1997 22:06:51 -0400
Organization: Not very
References: 97-04-091 97-04-109 97-04-128 97-04-145
Keywords: syntax

fjh@mundook.cs.mu.OZ.AU (Fergus Henderson) wrote:


>Herman Rubin complained about the "attrocious prenex syntax" of output
>mode arguments, and while I think "attrocious" is a too strong, and I
>don't think that there is necessarily anything wrong with using prefix
>notation for this sort of thing, he does have a point: it certainly
>helps if you can easily tell which arguments are input and which are
>output.


Much as I hate to bring up CMS-2 (the USN's answer to JOVIAL), it does
give you procedure calls with the general syntax


                    <procedure-name> [INPUT <input-args>] [OUTPUT <output-args>] $


(Actually, you can have EXIT arguments as well, but they are perhaps
better forgotten. As is most of the rest of the language.)


>I suppose the approach that Pieter Schoenmakers described is a
>compromise; in his language "Tom", tuples are not first-class types,
>and so it would probably be easy for a compiler to return tuples of
>results in registers.


This idea turns up on comp.lang.scheme from time to time. The multiple
value argument is a periodic occurrence on that group, but it never
seems to get anywhere, possibly for stylistic reasons. Multiple return
values, regardless of surface syntax, lead towards a "flat" style of
expression, with subexpressions tied together by named values (either
"let" variables or temporaries). Scheme allows this sort of thing with
the let* operator, but Scheme style traditionally favours nested
expressions.


Sean Case


---------------------------------------------
Sean Case gscase@tpgi.com.au
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.