I'm beginning to develop a chicken interface to the GNU scientific library 
(gsl). Several numerical procedures involve an operation such as:

gsl_XXX *ptr = gsl_XXX_alloc(...)

...

gsl_XXX_free(ptr)


I would like to define a chicken variable that manages the pointer. But I don't 
want to explicitely call the XXX_free function. Something like:

(define resource (make-gsl-XXX ...))

When the garbage collector collects resource, it would automatically call the 
function gsl_XXX_free (or a chicken wrapper of it).

Is that even possible?
If it isn't could someone suggest a "schemish" approach to the problem?

Thanks

Paulo



__________________________________________________
Fale com seus amigos  de graça com o novo Yahoo! Messenger 
http://br.messenger.yahoo.com/


_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to