Hi Julian! * Day, Julian <[email protected]> [130120 02:51]:
> I apologize in advance if this is a stupid question. I am writing > a roguelike game, and would like to use an embedded language for > doing quests and NPC dialogue. I've seen lots of information on > using Lua for these sorts of things, but I would like to use Scheme > because, well, I like coding in Scheme. Is it possible to, from > the C++ code, call Scheme scripts, which would be able to call C/C++ > functions to modify some game state in singleton instances? Is > this the way I should be thinking about the problem, or should I > be thinking about passing the state to/from the Scheme procedures? > Or is there a different approach I should use? This is an excellent question! Yes, you can use chicken as an embedded scripting language for your game. The manual has a section dedicated to that topic (embedding not games unfortunately): http://api.call-cc.org/doc/foreign/embedding See for an introduction into embedding. From a gut feeling I'd say that providing callable accessors for your scheme script to modify your game state is easier than passing around a lot of state all the time since all this state would have to be transformed into a scheme object and back to C/C++... So far people that use embedding have not spoken out loudly on this list, but I am sure there are people using this feature. That would be your clue guys! What are your experiences? You will most probably have lots of questions, feel free to come back and ask again. We value your feedback (and maybe that will lead to better documentation in the first place). Have fun using chicken! Christian -- In the world, there is nothing more submissive and weak than water. Yet for attacking that which is hard and strong, nothing can surpass it. --- Lao Tzu _______________________________________________ Chicken-users mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/chicken-users
