|
From: | Naitik Shah |
Subject: | Re: [Chicken-users] Safely holding on to a <procedure> reference in C |
Date: | Tue, 22 Feb 2011 20:37:36 -0800 |
(define _callbacks (make-hash-table))(define _callbackIndex 0)(define (get-callback index)(hash-table-ref _callbacks index))(define (register-callback! cb)(set! _callbackIndex (+ _callbackIndex 1))(hash-table-set! _callbacks _callbackIndex cb)_callbackIndex)(define (delete-callback! index)(hash-table-delete! _callbacks index))
[Prev in Thread] | Current Thread | [Next in Thread] |