public
anonymous / gist:3764529
Created

simple racket 3m embed

  • Download Gist
gistfile1.cpp
C++
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
#include <stdio.h>
 
#include "scheme.h"
 
static __declspec(thread) void *tls_space;
 
static int run(Scheme_Env *e, int argc, char *argv[])
{
Scheme_Object *curout = NULL, *v = NULL, *a[2] = {NULL, NULL};
Scheme_Config *config = NULL;
int i;
mz_jmp_buf * volatile save = NULL, fresh;
MZ_GC_DECL_REG(8);
MZ_GC_VAR_IN_REG(0, e);
MZ_GC_VAR_IN_REG(1, curout);
MZ_GC_VAR_IN_REG(2, save);
MZ_GC_VAR_IN_REG(3, config);
MZ_GC_VAR_IN_REG(4, v);
MZ_GC_ARRAY_VAR_IN_REG(5, a, 2);
MZ_GC_REG();
Scheme_Object * collectPath = scheme_make_path("%RACKETDIR%\\collects");
Scheme_Object * collectPathList = scheme_build_list(1, &collectPath);
scheme_init_collection_paths(e, collectPathList);
 
v = scheme_intern_symbol("racket/base");
scheme_namespace_require(v);
 
MZ_GC_UNREG();
return 0;
}
int main(int argc, char *argv[])
{
scheme_register_tls_space(&tls_space, 0);
return scheme_main_setup(1, run, argc, argv);
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.