I'd like to be able to write something like this:

(let loop ([a 1] [b 2])
   (if (= a b)
      3
      (loop (values (add1 a) b))))

This would match the way for/fold works with more than one value.
However, I get a message, "context expected 1 value, received 2
values: 2 2", which makes sense given the expansion of named let, but
it would be nice if this worked.  Using (call-with-values (lambda ()
(values (add1 a) b)) loop) works, but that seems to defeat the point
of using a named-let form for clarity.  I could also use let-values to
deconstruct the values and pass them individually to the loop, but
that hardly seems better.  Is there a better way?

Justin
_________________________________________________
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users

Reply via email to