Open rlepigre opened 3 years ago
Le 21-01-10 07:34:30, Rodolphe Lepigre a écrit :
Instead of having two functions set_callback and unsetcallback for each callback, I think it would be simpler to only have set*_callback, and have it take an optional function as argument (the Some case installing a callback, the None cas removing it). What do you think?
I find a bit bizarre to have the default with no extra arg removing the call-back. I think a bit and look at that. I did not forget your idea to use a macro on the C size by the way.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.*
I find a bit bizarre to have the default with no extra arg removing the call-back.
It does make sense if you see it in the following way:
set_idle_callback None
you set the idle callback to be no callback,set_idle_callback (Some f)
you set it to be function f
.
Instead of having two functions
set_*_callback
andunset_*_callback
for each callback, I think it would be simpler to only haveset_*_callback
, and have it take an optional function as argument (theSome
case installing a callback, theNone
cas removing it). What do you think?