Re: [Haskell-cafe] Could FFI support pass-by-value of structs?

2009-06-23 Thread John Meacham
On Tue, Jun 16, 2009 at 10:48:19AM -0300, Maurí­cio wrote: It's not usual, but it is allowed to have values of structs passed between functions directly instead of using pointers: /*/ struct ex { int x; int y; int z; }; ex example_functions (ex p) { (...) }

Re: [Haskell-cafe] Could FFI support pass-by-value of structs?

2009-06-23 Thread Felipe Lessa
On Tue, Jun 16, 2009 at 10:48:19AM -0300, Maurí­cio wrote: /*/ struct ex { int x; int y; int z; }; ex example_functions (ex p) { (...) } /*/ You may adopt the approach I used with Hipmunk[1] where there is a wrapper library written in C. For your example you

[Haskell-cafe] Could FFI support pass-by-value of structs?

2009-06-16 Thread Maurí­cio
It's not usual, but it is allowed to have values of structs passed between functions directly instead of using pointers: /*/ struct ex { int x; int y; int z; }; ex example_functions (ex p) { (...) } /*/ Would it be possible to allow that in Haskell FFI by, say, allowing