comments Marc Feeley 04 May 2020 21:21 UTC

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