Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

closures in c

Name: Anonymous 2012-01-25 2:28

thou shalt always accompany a call back with a void* argument that may be used arbitrarily by the caller:


void kind_values(struct relation* self, char* key, void(*call_back)(void* userdata, char* value), void* userdata) {
  for(char* value matching key in self) {
    call_back(userdata, value);
  }
}


and thou shalt have the satisfaction of passing a closure through the stack.

Name: Anonymous 2012-01-25 15:59

>>1
closures in c
for(char* value matching key in self)
What, is this some new shit in C11 or something?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List