guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: question about values


From: John Cowan
Subject: Re: question about values
Date: Wed, 18 Mar 2020 10:06:59 -0400

There is going to be a performance penalty, because you are taking multiple
values (which is not a value) and making it into a value by creating a
list.  There is no getting away from that except to exclude multiple values.

Note also that if the procedure throws an exception, your finalizer will
never be run.  Consider using dynamic-wind, whose whole purpose is to make
sure that an initializer and a finalizer are always run.

On Wed, Mar 18, 2020 at 9:11 AM Massimiliano Gubinelli <
address@hidden> wrote:

>
> > On 18. Mar 2020, at 13:39, Matt Wette <address@hidden> wrote:
> >
> >
> > How about calling (my-macro/values bar) where my-macro/values expands to
> >
> > (call-with-values (lambda () (bar))
> >   (lambda args (finalization-code) (apply values args))
> >
> > Matt
> >
> >
>
> Yeah! I like this better. But still wraps and unwraps the result.
>
>  Is there any performance penalty in that?
>
> Apart from my specific user case I wonder how and why in general multiple
> values are used. Seems they are not well integrated in the current Guile
> implementation. In my naive opinion the behaviour of Guile 1.8 was more
> consistent.
>
> Max
>
>
>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]