lilypond-devel
[Top][All Lists]
Advanced

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

Re: C++ question on wrapper API for setting Guile fluids


From: Luca Fascione
Subject: Re: C++ question on wrapper API for setting Guile fluids
Date: Thu, 21 Apr 2022 12:30:48 +0200

I wonder if you can 'chain' them:

Dynwind_context dwc2(dwc);

(you can at a minimum 'pause' dwc so to emit a runtime message that the
"wrong" thing is happening, but I guess you could hand yourself to your
parent and do more sophisticated shenanigans too... I must say I loathe
this stateful stuff though)

L

On Thu, Apr 21, 2022 at 12:23 PM Dan Eble <dan@lyric.works> wrote:

> On Apr 21, 2022, at 02:55, Luca Fascione <l.fascione@gmail.com> wrote:
> >
> > I'd think you can up this by one, and get a cleaner looking piece of code
> > if you implement scm_dynwind_fluid() as a forwarded method on your
> context:
> ...
> >  dwc.fluid (fluid2, value2);
>
> Here's something that does bother me.  That reads as if dwc holds state
> affecting the outcome, which is untrue.
>
>     {
>       Dynwind_context dwc;
>       // . . .
>
>       {
>         Dynwind_context dwc2;
>         // . . .
>         dwc.free (p);  // not what it seems
>         // . . .
>       }
>     }
>
> The scm_ functions operate implicitly on the current context.  Dressing
> them differently would be confusing.
>
> Dan
>
>

-- 
Luca Fascione
Distinguished Engineer - Ray Tracing - NVIDIA


reply via email to

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