Hello!
Any pointers would be much appreciated. I am trying out Chibi on my ancient little laptop running NixOS. I'm starting with the example code from the "Embedding in C" quickstart, but my little display snippet in a scheme file doesn't output anything, and when I step through it in gdb I see a "sexp.c: No such file or directory" warning. I've tried an absolute path, a relative path, but no joy. I'm compiling with "gcc -Wall hello.c -o hello -l chibi-scheme". The hello.ss file just contains (import (chibi)) (display "Hello World!")(newline)
The example code from
here:
#define SEXP_USE_GREEN_THREADS 0
#include <stdio.h>
#include <chibi/eval.h>
void dostuff(sexp ctx) {
/* declare and preserve local variables */
sexp_gc_var1(obj1);
sexp_gc_preserve1(ctx, obj1);
/* load a file containing Scheme code */
obj1 = sexp_c_string(ctx, "hello.ss", -1);
sexp_debug(ctx, "Obj1: ", obj1);
sexp_load(ctx, obj1, NULL);
sexp_eval_string(ctx, "(display \"this is a test.\")", -1, NULL);
/* release the local variables */
sexp_gc_release2(ctx);
}
int main(int argc, char** argv) {
sexp ctx;
sexp_scheme_init();
ctx = sexp_make_eval_context(NULL, NULL, NULL, 0, 0);
sexp_load_standard_env(ctx, NULL, SEXP_SEVEN);
sexp_load_standard_ports(ctx, NULL, stdin, stdout, stderr, 1);
dostuff(ctx);
sexp_destroy_context(ctx);
}