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

Common Lisp in C

Name: Anonymous 2012-10-03 17:23

Lets write Common Lisp functions in generic C code.


/* (map #'func array) => map(array,length_of_array,sizeof(array),function_pointer) */
void *map(void *base,size_t len,size_t elemnsize, void (*func)(void *,void *)) {
  void *b = malloc(elemsize*len);
  size_t i;
  for(i=0;i<len;++i){
    func(b+(elemsize*1),base);
    base += elemsize;
  }
  return b;
}

Name: Anonymous 2012-10-04 20:27

>>38
You use unoptimized quotes on purpose, right? You want me to tell you to optimize your quotes, Ahmed?

I'm flattered, Ahmed-chan.

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