Re: [racket-users] "Immobile" lambdas for FFI

2018-03-15 Thread Dmitry Pavlov
Matthew, I agree with John on this one. In case you decide to release the files, you may want to correct the comment in callback.rkt: it has (define b #f) and (define b null) where I believe you mean (define b (box #f)) and (define b (box null)), respectively. Also, among listed options for

Re: [racket-users] "Immobile" lambdas for FFI

2018-03-15 Thread 'John Clements' via Racket Users
> On Mar 14, 2018, at 6:22 PM, Matthew Flatt wrote: > > Would it make sense to add these two examples to the documentation? Perhaps just as links to github gists? Apologies if they’re already there; I took a quick look and didn’t see them. (I suggest this selfishly,

Re: [racket-users] "Immobile" lambdas for FFI

2018-03-15 Thread Dmitry Pavlov
Matthew, On 03/15/2018 04:22 AM, Matthew Flatt wrote: At Wed, 14 Mar 2018 21:56:05 +0300, Dmitry Pavlov wrote: I suspect that "my-callback" or something linked to it are moved in memory by the garbage collector, and the pointer kept by the C library is no longer valid. In the first simpler

Re: [racket-users] "Immobile" lambdas for FFI

2018-03-14 Thread Matthew Flatt
At Wed, 14 Mar 2018 21:56:05 +0300, Dmitry Pavlov wrote: > I suspect that "my-callback" or something linked to it are moved > in memory by the garbage collector, and the pointer kept by > the C library is no longer valid. In the first simpler > case, that does not happen because it sets and uses