Try `(call-with-values func void)`

http://docs.racket-lang.org/reference/values.html#%28def._%28%28quote._~23~25kernel%29._call-with-values%29%29

On Tue, May 16, 2017 at 5:56 PM, David Storrs <david.sto...@gmail.com>
wrote:

> I have a macro that wraps a function call in some debugging information.
> I would like to discard the results of the function call so that they don't
> end up printed.  This usually works:
>
>   (void (func))
>
> ...but it fails if func uses (values) to return multiple values, since
> void is variadic but not multiple-return tolerant.  I have solved the
> problem with (the equivalent of) wrapping it in a thunk:  ((thunk (func)
> (void)) but that's clumsy.
>
> This is a specific example of the more general question "how could I
> capture the result of a function call without knowing how many values will
> come back or if it's normal return / multiple return?"
>
> I've been through the docs on multiple return and I don't see a way to
> handle this.  Is there one?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to