[racket-dev] FFI: pointer to an array in a C struct type

2012-12-03 Thread Neil Toronto
This error seems wrong: #lang racket (require ffi/unsafe ffi/unsafe/cvector) (define-cstruct _mpz ([alloc _int] [size _int] [limbs (_gcable _cvector)])) (define z (make-mpz 1 1 (list-cvector '(1) _long))) (mpz-limbs z) _cvector: cannot

Re: [racket-dev] FFI: pointer to an array in a C struct type

2012-12-03 Thread Tobias Hammer
On Mon, 03 Dec 2012 11:45:08 +0100, Neil Toronto neil.toro...@gmail.com wrote: This error seems wrong: #lang racket (require ffi/unsafe ffi/unsafe/cvector) (define-cstruct _mpz ([alloc _int] [size _int] [limbs (_gcable _cvector)]))

Re: [racket-dev] FFI: pointer to an array in a C struct type

2012-12-03 Thread Matthew Flatt
At Mon, 3 Dec 2012 12:31:37 +0100, Tobias Hammer wrote: On Mon, 03 Dec 2012 11:45:08 +0100, Neil Toronto neil.toro...@gmail.com wrote: This error seems wrong: #lang racket (require ffi/unsafe ffi/unsafe/cvector) (define-cstruct _mpz ([alloc _int]

Re: [racket-dev] FFI: pointer to an array in a C struct type

2012-12-03 Thread Neil Toronto
On 12/03/2012 07:31 AM, Matthew Flatt wrote: At Mon, 3 Dec 2012 12:31:37 +0100, Tobias Hammer wrote: On Mon, 03 Dec 2012 11:45:08 +0100, Neil Toronto neil.toro...@gmail.com wrote: This error seems wrong: #lang racket (require ffi/unsafe ffi/unsafe/cvector) (define-cstruct _mpz

Re: [racket-dev] FFI: pointer to an array in a C struct type

2012-12-03 Thread Neil Toronto
On 12/03/2012 12:10 PM, Matthew Flatt wrote: At Mon, 03 Dec 2012 11:05:10 -0700, Neil Toronto wrote: On 12/03/2012 07:31 AM, Matthew Flatt wrote: Neil, can you say more about how `_mpz' instances are used with foreign functions? They represent GMP's bignums, and they're used as both input