Aha, right.  
So probably what bugged me was values-length.  I took it as a fundamental primitive like
length and vector-length, but actually It's pretty niche, only to be used when
you can throw away all the results but just want to know the number of values.
I won't oppose to have it for the completeness, though.



On Sun, May 10, 2020 at 11:25 PM Lassi Kortela <xxxxxx@lassi.io> wrote:
> Gauche has values->list and values-ref.   It is indeed handy.
> However, it's a bit difficult to make those primitives cover the
> necessary situations.
> Suppose you want to branch by the number of values yielded by EXPR.
>
>     (if (= (values-length EXPR) 1)
>        (let ((val EXPR))   ;; fast path
>           ...)
>        (let ((vals (values->list EXPR))) ;; generic path
>           ...))
>
> You have to evaluate EXPR twice.   If you want to make it evaluate once,
> you have to reify it
> in some way, which defeats the original motivation to write this kind of
> code.

The case-receive (by analogy to case-lambda) proposed by Marc solves
this nicely.