Re: [rust-dev] Calling back into Rust from C code

2013-05-12 Thread Matthieu Monrocq
As the error implies, the function type that you try to pass as a callback is incorrect. The problem is that because the callback is called from C it ought to be compatible with C, thus the extern bit. Rather than defining an anonymous function, you need to write an extern fn function (with a

Re: [rust-dev] Calling back into Rust from C code

2013-05-12 Thread Florian Weimer
* Skirmantas Kligys: I am trying to write a native wrapper for https://github.com/pascalj/rust-expat (BTW, if there is a native Rust XML parser, I am interested to hear about it, did not find it). I have trouble calling back into Rust from C code: It's probably better to avoid calling

[rust-dev] Adding exception handling as syntax sugar with declared exceptions

2013-05-12 Thread Bill Myers
This is a suggestion for adding an exception system to Rust that satisfies these requirements: 1. Unwinding does NOT pass through code that is not either in a function that declares throwing exceptions or in a try block (instead, that triggers task failure) 2. Callers can ignore the fact that a