craff / gles3

ocaml bindings for gles3
GNU Lesser General Public License v3.0
5 stars 0 forks source link

Suggestion: single function per callback #9

Open rlepigre opened 3 years ago

rlepigre commented 3 years ago

Instead of having two functions set_*_callback and unset_*_callback 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?

craff commented 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.*

rlepigre commented 3 years ago

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: