Re: [racket-dev] foreign struct access different in 5.1.3?
At Sat, 17 Sep 2011 07:44:50 -0600, Kevin Tew wrote: If you would like document the fact that cstructs are generative only up to version 5.1.3. I think that improve the docs. I think the right next step is for you (Kevin) to update doc/release-notes/racket/HISTORY.txt to describe the change. _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] foreign struct access different in 5.1.3?
I'll do that. Kevin On 09/17/2011 07:53 AM, Matthew Flatt wrote: At Sat, 17 Sep 2011 07:44:50 -0600, Kevin Tew wrote: If you would like document the fact that cstructs are generative only up to version 5.1.3. I think that improve the docs. I think the right next step is for you (Kevin) to update doc/release-notes/racket/HISTORY.txt to describe the change. _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
[racket-dev] foreign struct access different in 5.1.3?
I'm trying to backport working FFI code to 5.1.3, and I'm having trouble referring to elements of a C struct. Specifically, in the presence of this definition (define-cstruct _rack-audio-closure ([sound _pointer] [cur-sample_ulong] [num-samples _ulong] [stop-now _bool] [stop-sema-ptr _pointer])) using the function (rack-audio-closure-cur-sample) on the result of an FFI call with signature (_fun _pointer _ulong _pointer - _rack-audio-closure-pointer) produces this error: rack-audio-closure-cur-sample: expected argument of type struct:rack-audio-closure; given #cpointer:rack-audio-closure in 5.1.3, but it works just fine in the git head. Git log suggests to me that you (Kevin) might have changed/fixed this in a810b30b872787a1365c, so here's the question: is there some workaround to access the elements of a C struct in 5.1.3? Many thanks, John smime.p7s Description: S/MIME cryptographic signature _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] foreign struct access different in 5.1.3?
On Sep 16, 2011, at 3:06 PM, John Clements wrote: I'm trying to backport working FFI code to 5.1.3, and I'm having trouble referring to elements of a C struct. Specifically, in the presence of this definition (define-cstruct _rack-audio-closure ([sound _pointer] [cur-sample_ulong] [num-samples _ulong] [stop-now _bool] [stop-sema-ptr _pointer])) using the function (rack-audio-closure-cur-sample) on the result of an FFI call with signature (_fun _pointer _ulong _pointer - _rack-audio-closure-pointer) produces this error: rack-audio-closure-cur-sample: expected argument of type struct:rack-audio-closure; given #cpointer:rack-audio-closure in 5.1.3, but it works just fine in the git head. More research suggests that the problem is more limited; it looks like a problem of generativity. That is, if I have two modules that declare the same cstruct (same name, same fields, same types) then cpointers to these structures returned by functions from the first module cannot be accessed in the other module. AFAICT, This is not the case in more recent versions; that is, these cstructs are not generative. Assuming this is deliberate, I could document it. John smime.p7s Description: S/MIME cryptographic signature _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev