Re: [racket-users] Fun with Physics: Racket FFI Question (Bug?)

2018-09-18 Thread Stephen Foster
Thanks, this is super helpful. :) On Monday, September 17, 2018 at 9:58:06 AM UTC-7, Matthew Flatt wrote: > > At Mon, 17 Sep 2018 09:34:46 -0700 (PDT), Stephen Foster wrote: > > But when I have two bodies that share the same velocity_func, I get a > > segfault: > > The problem is that a

Re: [racket-users] Fun with Physics: Racket FFI Question (Bug?)

2018-09-17 Thread Matthew Flatt
At Mon, 17 Sep 2018 09:34:46 -0700 (PDT), Stephen Foster wrote: > But when I have two bodies that share the same velocity_func, I get a > segfault: The problem is that a callback is retained (by default) as long as the function that it wraps is retained, but only a single callback is retained

[racket-users] Fun with Physics: Racket FFI Question (Bug?)

2018-09-17 Thread Stephen Foster
I'm trying to get the Chipmunk Physics library integrated with Racket. I've made some progress (https://www.youtube.com/watch?v=GjvLaP7I0gg), but I need to ask for some input on an issue. The Chipmunk C library provides a primitive called a "cpBody" (i.e. a moving thing). A cpBody struct has