More Finaliser Trouble

2003-07-13 Thread Ashley Yakeley
How do I pass a parameter to a finaliser? The pointer itself does not have enough information to run the finaliser, I need an extra parameter available at the time the pointer is created. This was easy to do when I could write finalisers in Haskell, of course, since I could just apply the

Re: More Finaliser Trouble

2003-07-13 Thread Alastair Reid
[...] doesn't answer the question of why these things have changed [...] We dropped Haskell finalizers because neither Hugs nor NHC could implement them and implementing them would pretty much require them to implement preemptive concurrency (i.e., multiple threads each with their own stacks).

RE: More Finaliser Trouble

2003-07-13 Thread Wolfgang Thaller
Daan Leijen [EMAIL PROTECTED] wrote: (allthough it doesn't answer the question of [...] how to add parameters to the new newForeignPtr function,) Should there perhaps be something like ... newForeignPtrWithUserData :: Ptr a - Ptr b - FunPtr (Ptr a - Ptr b - IO ()) - IO (ForeignPtr a) ... where