7 ms·
I tried to find a way to store a function in an object to call later, and after fighting the syntax I hit a bus error. I guess that is only possible with full
by webjprgm 13y ago
I tried to find a way to store a function in an object to call later, and after fighting the syntax I hit a bus error. I guess that is only possible with full closures.
I was trying to have a vector of behaviors for my sprites, which would hold arbitrary functions to call when updating the sprite. I don't need to capture any variables, so I don't actually need a closure. But the scope in which the anonymous function was initially created is long gone, so that's probably the issue.
I'll see if co-routines can solve this for me ...