Good point with dynamic-wind. Does it pass along also multiple values or has the same problem?
m > On 18. Mar 2020, at 15:06, John Cowan <co...@ccil.org> wrote: > > 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 <m.gubine...@gmail.com > <mailto:m.gubine...@gmail.com>> wrote: > > > On 18. Mar 2020, at 13:39, Matt Wette <matt.we...@gmail.com > > <mailto:matt.we...@gmail.com>> 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 > > >