[plt-scheme] How do I convert (values ...) to something I can do something with?

From: Todd O'Bryan (toddobryan at gmail.com)
Date: Tue Mar 9 23:26:17 EST 2010

Never mind. I just wrote a little macro:

(define-syntax ->list
  (syntax-rules ()
    [(_ vals) (call-with-values (λ () vals) list)]))

and it seems to be doing what I want.

On Tue, Mar 9, 2010 at 11:14 PM, Todd O'Bryan <toddobryan at gmail.com> wrote:
> Thanks. I saw those, but they didn't register...
>
> If (foo 'x) returns multiple values, is there any easier way than
>
> (call-with-values (lambda () (foo 'x)) list)
>
> to convert it to a list?
>
> On Tue, Mar 9, 2010 at 11:05 PM, Carl Eastlund <cce at ccs.neu.edu> wrote:
>> On Tue, Mar 9, 2010 at 11:02 PM, Todd O'Bryan <toddobryan at gmail.com> wrote:
>>> I've written a function that returns multiple values. But now I can't
>>> figure out how to check the silly thing.
>>>
>>> Sorry if this is a stupid question, but how do I convert a (values
>>> ...) expression into something I can wrap my parentheses around?
>>>
>>> Todd
>>
>> If you know exactly how many values you'll be getting, use let-values
>> or define-values.  If you don't, use call-with-values.  They're all in
>> the Help Desk.
>>
>> --Carl
>>
>


Posted on the users mailing list.