I see Julian, so when you said you were looking for an "
embedded language for doing quests" that's exactly what you meant... :)
I'm curious how you end up splitting your data structures. Perhaps it's all in C/C++ and then you access then from Scheme? There's an example of you might do that, if you haven't found out already:
You can also use
chicken-bind to familiarize yourself with foreign-lambda and friends. Chicken-bind has almost a complete C/C++ parser and can produce foreign-lambdas:
$ echo "struct player { int level, health; }" | chicken-bind - -o -
;;; GENERATED BY CHICKEN-BIND FROM -
(begin
(define player-level
(foreign-lambda*
integer
(((c-pointer (struct "player")) s))
"return(s->level);"))
(define player-health
(foreign-lambda*
integer
(((c-pointer (struct "player")) s))
"return(s->health);"))
(define make-player
(foreign-lambda*
(c-pointer (struct "player"))
((integer level) (integer health))
"struct player *tmp_ = (struct player *)C_malloc(sizeof(struct player));\ntmp_->level = level;\ntmp_->health = health;\nreturn(tmp_);;\n")))
;;; END OF FILE
If you don't have it already, you can do `chicken-install bind` and play around. Note that `make-player` above leaks memory.
Best of luck!
K.