From: Andy Wingo <wingo@pobox.com>
To: marco.maggi-ipsu@poste.it
Cc: guile-user@gnu.org, "Niels Möller" <nisse@lysator.liu.se>
Subject: Re: [OT] Re: Question on mutability of argument lists
Date: Thu, 20 Mar 2014 22:02:02 +0100 [thread overview]
Message-ID: <8761n8y46t.fsf@pobox.com> (raw)
In-Reply-To: <87zjklgp5x.fsf_-_@governatore.luna> (Marco Maggi's message of "Thu, 20 Mar 2014 11:06:18 +0100")
On Thu 20 Mar 2014 11:06, Marco Maggi <marco.maggi-ipsu@poste.it> writes:
> Something similar can be done for return values[1]; in
> Vicare every function call site has 2 return points: one for
> single return value; the other for 0, 2, more return values.
> One return point goes on with the computation, the other
> raises an exception.
>
> [1] Ashley and Dybvig. "An Efficient Implementation of
> Multiple Return Values in Scheme". Proceedings of the 1994
> ACM Conference on Lisp and Functional Programming, 140-149,
> Orlando, June 1994.
Incidentally I think this is not such a nice approach -- multiple-value
returns kill the return-branch buffer. I suspect this is a very 1994
strategy. For example, it's common to call a function and discard its
arguments. This is trivial with a single return location. With MV you
miss the return-branch buffer and you still play jump games. The
single-value return is also very easy -- just check the
number-of-return-values register (or, if values are on the stack, check
the stack pointer) and branch to error if you didn't get the right
number. Branch prediction helps here.
Andy
--
http://wingolog.org/
prev parent reply other threads:[~2014-03-20 21:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-19 9:34 Question on mutability of argument lists Niels Möller
2014-03-19 17:01 ` Marco Maggi
2014-03-19 19:25 ` Mark H Weaver
2014-03-19 19:56 ` Niels Möller
2014-03-20 10:06 ` [OT] " Marco Maggi
2014-03-20 10:54 ` Niels Möller
2014-03-20 21:02 ` Andy Wingo [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8761n8y46t.fsf@pobox.com \
--to=wingo@pobox.com \
--cc=guile-user@gnu.org \
--cc=marco.maggi-ipsu@poste.it \
--cc=nisse@lysator.liu.se \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).