[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MIT-Scheme-devel] R7RS and values.
From: |
Taylor R Campbell |
Subject: |
Re: [MIT-Scheme-devel] R7RS and values. |
Date: |
Fri, 4 Nov 2016 01:11:17 +0000 |
Date: Thu, 3 Nov 2016 18:00:17 -0700
From: Matt Birkholz <address@hidden>
> That excerpt is about (begin (values 1 2 3) ...). [repeat of 1st excerpt]
>
> [second excerpt]
>
> That excerpt is about (list (values 1 2 3)), which I strongly advise
> that we report noisily.
Is there a way for VALUES to distinguish them?
Sure, it can detect RC_EXECUTE_SEQUENCE_FINISH, just like it detects
RC_MULTIPLE_VALUES. What other return codes you need to worry about,
I don't know offhand.
> I might be breaking things (again!). While I've removed our
> restriction on VALUES (that it and only it return to CALL-WITH-
> VALUES), I have also removed an "extension" that allowed e.g. cleanup-
> noop-nodes to pass along multiple values as if they were one. It was
> not a documented extension, yet losing it will break unwary code.
> Perhaps just a mention in the release notes?
I thought it was a bug, not a feature. Is fixing the bug now a bug,
not a feature?
It is a bug that (list (values 1 2 3)) works, whatever value it gives.
But we have long relied on a particular manifestation of that bug
whereby if you do
(call-with-values (lambda () (car (list (values 1 2 3)))) list),
you get back the list (1 2 3). You've replaced it by a manifestation
where that gives back the list (1). This quietly breaks various code
in MIT Scheme.
Yes. Right now the VALUES primitive in that branch cannot distinguish
between (list (values...)) and (begin (values...)) as far as I know.
If it does not require major changes to the compiler, I'd be happy to
code VALUES for the distinction.
Not sure offhand what it will entail in the compiler. Whatever you
do, please add some automatic tests of VALUES with many different
types of continuations and of several different CALL-WITH-VALUES
producers, compiled and interpreted and single-value and multi-value
alike.
- Re: [MIT-Scheme-devel] R7RS and values., Matt Birkholz, 2016/11/02
- Re: [MIT-Scheme-devel] R7RS and values., Taylor R Campbell, 2016/11/02
- Re: [MIT-Scheme-devel] R7RS and values., Taylor R Campbell, 2016/11/02
- Re: [MIT-Scheme-devel] R7RS and values., Matt Birkholz, 2016/11/03
- Re: [MIT-Scheme-devel] R7RS and values., Taylor R Campbell, 2016/11/03
- Re: [MIT-Scheme-devel] R7RS and values., Matt Birkholz, 2016/11/03
- Re: [MIT-Scheme-devel] R7RS and values., Taylor R Campbell, 2016/11/03
- Re: [MIT-Scheme-devel] R7RS and values., Matt Birkholz, 2016/11/03
- Re: [MIT-Scheme-devel] R7RS and values., Taylor R Campbell, 2016/11/03
- Re: [MIT-Scheme-devel] R7RS and values., Matt Birkholz, 2016/11/03
- Re: [MIT-Scheme-devel] R7RS and values.,
Taylor R Campbell <=