Dear Marc,
I am currently finishing SRFI 195 and I have thought again about your
proposal to allow (box ...) to be the same as (values ...).
What would be the value of the following expression?
(let-values ((x (box 1 2 3)))
x)
Under your proposal, replacing "box" with "values", the value would be
the list (1 2 3). In the original proposal of this SRFI (and in
Schemes that do not or cannot equate "box" and "values"), the value
would be a single-element list.
Furthermore, under your proposal, it is not clear to me what the value of
(let-values ((x (box 1)))
x)
would be? By the way you seem to have implemented SRFI 111 boxes, this
would be a single-element list containing a proper box object and not
just the value 1. But this would be inconsistent to the value of the
first expression.
Am Mo., 4. Mai 2020 um 23:21 Uhr schrieb Marc Feeley <xxxxxx@iro.umontreal.ca>:
>
> It should be specified that it is an error to call set-box! with a number of values that is different than the number of values in the box being set. In other words, set-box! does not allocate memory.
>
> Your extension to boxes reminds me of how multiple values are implemented in Gambit, with a “values object” which is in effect SRFI 195 boxes, in the sense that (box A B C) is Gambit’s (values A B C). For that reason I would like your SRFI to specify that it is allowed, but not required, that
>
> (box X ...) is equivalent to (values X ...)
> (unbox b) is equivalent to b
>
> Marc
>
>