[CM] Possible bug with c-object & openlet

Christos Vagias chris.actondev at gmail.com
Mon Dec 20 10:00:19 PST 2021


Thanks for the tip Bil!
Good to know also about the reasoning behind this behaviour.

By paying a (belated) visit to the documentation I also saw the "Don't
forget to GC-protect the let!"...
It just seemed obvious to me that it would be protected. But either
manually protecting it, or storing it somewhere -causing it to be
protected- makes much sense.

Thanks again, and happy holidays!


On Mon, 20 Dec 2021 at 17:11, <bil at ccrma.stanford.edu> wrote:
>
> You need to gc protect the methods -- c_object_set_let
> does not do that.  This is partly for speed and to save
> space in the gc-protected-objects list, and also because
> you might create the let holding the methods, then
> any amount of time might go by before you make an
> object, so the let has to be gc-protected anyway.
> g_block_methods in s7test.scm is an example where
> each block can be considered an instance of the
> g_block class, and the let is protected once.
>


More information about the Cmdist mailing list