Skip to content

anonymous /gist:3764529
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
simple racket 3m embed
#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);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.