[CM] pre-parsing scheme code

bil at ccrma.Stanford.EDU bil at ccrma.Stanford.EDU
Mon Mar 21 13:32:19 PDT 2022


Here's an example:

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "s7.h"

int main(int argc, char **argv)
{
   s7_scheme *s;
   s7_pfunc f;
   s7_pointer body;
   int i;
   s = s7_init();
   body = s7_list_nl(s, 4, s7_make_symbol(s, "list"),	\
	       s7_make_integer(s, 1),		\
	       s7_make_integer(s, 2),		\
	       s7_make_integer(s, 3),		\
	       NULL);
   f = s7_optimize(s, s7_list(s, 1, body));
   if (!f) fprintf(stderr, "oops\n");
   else
     for (i = 0; i < 2000000; i++)
       f(s);
}

/* 130 in callgrind */



More information about the Cmdist mailing list