[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[MIT-Scheme-devel] call-with-values requires thunk to use 'values'? Why?
From: |
Daniel Katz |
Subject: |
[MIT-Scheme-devel] call-with-values requires thunk to use 'values'? Why? |
Date: |
Sun, 12 Dec 2010 23:25:57 -0500 |
Hi!
I tried loading Neil Van Dyke's 'testeez' unit testing package (which is
designed to be R5RS compliant) into MIT-scheme 9.0.1 today, and ran into
trouble with 'call-with-values'. In particular, for some test I wrote it turns
out that a part of Neil's code ends up as the form
(call-with-values (lambda () 4) list)
which MIT-scheme fails to appreciate:
>
> 1 > (call-with-values (lambda () 4) list)
>
> ;The object 4 is not applicable.
> ;To continue, call RESTART with an option number:
> ; (RESTART 2) => Specify a procedure to use in its place.
> ; (RESTART 1) => Return to read-eval-print level 1.
>
> 2 error> (restart 1)
>
> ;Abort!
The MIT-scheme documentation implies that the first function really ought to
return its values using the 'values' form, which does work:
> 1 > (call-with-values (lambda () (values 4)) list)
>
> ;Value 3: (4)
but when I look at R5RS, there doesn't seem to be anything in the description
of call-with-values that would require the use of 'values' to return the values
from the first argument to call-with-values. In fact, R5RS even gives an
example where that's not true
(http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-9.html#%_idx_574):
(call-with-values * -) ===> -1
which also doesn't work in MIT-scheme 9.0.1:
> 1 > (call-with-values * -)
>
> ;The object 1 is not applicable.
> ;To continue, call RESTART with an option number:
> ; (RESTART 2) => Specify a procedure to use in its place.
> ; (RESTART 1) => Return to read-eval-print level 1.
>
> 2 error>
Is this just a 'yet to be finished' area of R5RS compliance for MIT-scheme? Or
is there some particular reason why the 'values' requirement on
'call-with-values' has been imposed?
Thanks!
Dan
- [MIT-Scheme-devel] call-with-values requires thunk to use 'values'? Why?,
Daniel Katz <=