Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!das-news.harvard.edu!news2.near.net!MathWorks.Com!yeshua.marcam.com!usc!elroy.jpl.nasa.gov!decwrl!amd!amdahl!netcomsv!ix.netcom.com!netcom.com!hbaker
From: hbaker@netcom.com (Henry G. Baker)
Subject: Re: Multiple values
Message-ID: <hbakerCwyEwq.AJB@netcom.com>
Organization: nil
References: <g2mgTc2w165w@sytex.com>
Date: Fri, 30 Sep 1994 17:50:49 GMT
Lines: 42

In article <g2mgTc2w165w@sytex.com> smcl@sytex.com (Scott McLoughlin) writes:
>Howdy,
>        Any advice/pointers to literature available on 
>efficiently implementing CL multiple values?  I've
>picked up  a few general ideas reading through
>"Performance and Eval..." and the description of
>CMU CL in Lee's (ed) "Topics in Advanced..."  No hard
>specifics, though.  I'm particularly interested in
>the ways MV and dynamic non-local exits (throw) and
>captured (blocks) and (unwind-protect) forms interact.
>        In a perfectly tail-recursive world, I can
>imagine a very simple implementation, but with the
>various forms of dynamic binding, our implementation
>is not always perfectly tail recursive as it stands.

I seem to recall that some of the folks at the University of Indiana
have written papers about efficient multiple values in Scheme.  Sorry
I don't have any references.

The 'obvious' good way to pass multiple values is to return them in
registers completely analogously to passing arguments.  Andrew Appel
has investigated this for SML/NJ, where it is very easy, due to its
continuation-passing style.  However, even in a more traditional stack
environment, multiple register results are possible and efficient.
Expertelligence's Lisp for the Macintosh did this.  The biggest
problem seems to be the tremendous incompatibility with standard
calling sequences, where compatibility is necessary when interfacing
with 'standard' languages like C & Fortran.

>BTW: I wish to sincerely thank Henry Baker for making
>.ps versions of many of his papers available on line.
>A banquet of food for thought for this (non-academic)
>Lisper who doesn't have a university library near at
>hand.

You're very welcome.  I'm going to continue adding stuff as I have
time.  I've gotten permission from ACM to put my 1978 CACM papers
online for research purposes.

      Henry Baker
      Read ftp.netcom.com:/pub/hbaker/README for info on ftp-able papers.

