Xref: utzoo comp.lang.c:7930 comp.lang.misc:1170 Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!pasteur!agate!aurora!labrea!glacier!jbn From: jbn@glacier.STANFORD.EDU (John B. Nagle) Newsgroups: comp.lang.c,comp.lang.misc Subject: Re: The D Programming Language Message-ID: <17351@glacier.STANFORD.EDU> Date: 8 Mar 88 18:10:12 GMT References: <25284@cca.CCA.COM> <700@l.cc.purdue.edu> <505@sun.soe.clarkson.edu> Reply-To: jbn@glacier.UUCP (John B. Nagle) Organization: Stanford University Lines: 12 If you want multiple values from functions, look at Mesa, which offers an efficient approach. In Mesa, all functions effectively take one argument and return one result, but both are structures. The normal function call syntax is treated as a structure constructor which builds a structure out of the arguments, then passes the structure as a unit. The structure is usually built on the stack, and thus this is equivalent in an implementation sense to the passing of parameters on the stack. In turn, a function returns a result which is a structure. The space for that structure is allocated by the caller, on the stack, and its address is passed to the function, which then fills it in. This approach seems to work.