unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* values in a non-values context
@ 2018-06-15  0:56 Matt Wette
  2018-06-15  1:16 ` John Cowan
  0 siblings, 1 reply; 3+ messages in thread
From: Matt Wette @ 2018-06-15  0:56 UTC (permalink / raw)
  To: guile-user

I've looked in some RnRS documents and can't find answer to the following:
Is the value of a `values' expression in a non-values context defined?
In Guile, `(write (values 1 2 3))' generates `1'.  Does the language standard
specify this or is this determined by implementation?  In other words, is it
OK to count on this behavior?

Matt




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: values in a non-values context
  2018-06-15  0:56 values in a non-values context Matt Wette
@ 2018-06-15  1:16 ` John Cowan
  2018-06-16 15:48   ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: John Cowan @ 2018-06-15  1:16 UTC (permalink / raw)
  To: Matt Wette; +Cc: guile-user

It's determined by the implementation.  <
https://bitbucket.org/cowan/r7rs-wg1-infra/src/default/MultipleValues.md>
lists what several implementations actually do.  Many similar pages are
accessible from <
https://bitbucket.org/cowan/r7rs-wg1-infra/src/default/ImplementationContrasts.md
>.

On Thu, Jun 14, 2018 at 8:56 PM, Matt Wette <matt.wette@gmail.com> wrote:

> I've looked in some RnRS documents and can't find answer to the following:
> Is the value of a `values' expression in a non-values context defined?
> In Guile, `(write (values 1 2 3))' generates `1'.  Does the language
> standard
> specify this or is this determined by implementation?  In other words, is
> it
> OK to count on this behavior?
>
> Matt
>
>
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: values in a non-values context
  2018-06-15  1:16 ` John Cowan
@ 2018-06-16 15:48   ` Ludovic Courtès
  0 siblings, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2018-06-16 15:48 UTC (permalink / raw)
  To: guile-user

Hi,

John Cowan <cowan@ccil.org> skribis:

> It's determined by the implementation.  <
> https://bitbucket.org/cowan/r7rs-wg1-infra/src/default/MultipleValues.md>
> lists what several implementations actually do.  Many similar pages are
> accessible from <
> https://bitbucket.org/cowan/r7rs-wg1-infra/src/default/ImplementationContrasts.md
>>.

Indeed.  The choice starting with Guile 2.0 was to automatically
truncate multiple value returns in accordance with the number of values
expected by the continuation.

You can rely on multiple-value truncation in Guile, but be aware that
other Schemes may behave differently.

Ludo’.




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-06-16 15:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-15  0:56 values in a non-values context Matt Wette
2018-06-15  1:16 ` John Cowan
2018-06-16 15:48   ` Ludovic Courtès

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).