From: Chris Marusich <cmmarusich@gmail.com>
To: guile-user@gnu.org
Subject: Multiple values passed as single argument to procedure
Date: Sun, 11 Jun 2017 00:56:23 -0700 [thread overview]
Message-ID: <87mv9fnejc.fsf@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1495 bytes --]
Hi,
I've noticed that when one passes multiple values as a single argument
to a procedure, only the first value gets used. Is this expected?
Here's an example:
--8<---------------cut here---------------start------------->8---
$ guile
GNU Guile 2.2.2
Copyright (C) 1995-2017 Free Software Foundation, Inc.
Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.
Enter `,help' for help.
scheme@(guile-user)> (define (proc x) x)
scheme@(guile-user)> (proc (values 1 2))
$1 = 1
scheme@(guile-user)>
--8<---------------cut here---------------end--------------->8---
I've looked in a few places to try to figure out the answer to this
question, but I haven't found much. In addition to the guile-devel and
guile-user email list archives, I've checked the following sections in
the manual:
(guile) Binding Multiple Values
(guile) Lambda
(guile) Fly Evaluation
(guile) Compiled Procedures
(guile) Expression Syntax
However, I did find the following information in R6RS (Section 5.8:
"Multiple return values"), which seems possibly relevant:
"Not all continuations accept any number of values. For example, a
continuation that accepts the argument to a procedure call is guaranteed
to accept exactly one value. The effect of passing some other number of
values to such a continuation is unspecified."
--
Chris
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
next reply other threads:[~2017-06-11 7:56 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-11 7:56 Chris Marusich [this message]
2017-06-11 8:28 ` Multiple values passed as single argument to procedure David Kastrup
2017-06-11 20:36 ` Mark H Weaver
2017-06-11 21:31 ` Mark H Weaver
2017-06-12 0:19 ` Chris Marusich
2017-06-12 4:25 ` Mark H Weaver
2017-06-12 8:19 ` Chris Marusich
2017-06-12 8:55 ` Neil Jerram
2017-06-12 9:48 ` Neil Jerram
2017-06-12 9:39 ` David Kastrup
2017-06-12 11:31 ` Mark H Weaver
2017-06-12 14:24 ` David Kastrup
2017-06-13 2:26 ` Mark H Weaver
2017-06-13 3:09 ` Mark H Weaver
2017-06-13 3:45 ` Mark H Weaver
2017-06-13 11:17 ` dsmich
2017-06-26 11:25 ` Alex Vong
-- strict thread matches above, loose matches on Subject: below --
2017-09-01 19:39 Chris Marusich
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=87mv9fnejc.fsf@gmail.com \
--to=cmmarusich@gmail.com \
--cc=guile-user@gnu.org \
/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).