From 770a848889b174dd4a1dc6422c699cd5640fe318 Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Sun, 31 Mar 2019 11:29:33 +0200 Subject: [PATCH] Register procedures --- src/main.cpp | 7 +++++++ src/plugins/default/main.scm | 7 +++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 6c2e2a7..bb5a5f9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,9 +5,16 @@ using namespace irr; using namespace core; using namespace video; +SCM register_generator(SCM name, SCM proc) { + printf ("Register: %s\n", scm_to_locale_string(name)); + scm_call_0(proc); + return SCM_UNSPECIFIED; +} + int main() { scm_init_guile(); + scm_c_define_gsubr("register-generator", 2, 0, 0, (scm_t_subr)register_generator); scm_primitive_load(scm_from_locale_string("plugins/default/main.scm")); IrrlichtDevice* device = diff --git a/src/plugins/default/main.scm b/src/plugins/default/main.scm index 82d3d9d..b95e41c 100644 --- a/src/plugins/default/main.scm +++ b/src/plugins/default/main.scm @@ -1,2 +1,5 @@ -(display "Hello world!") -(newline) +(define (hello-world) + (display "Hello World!") + (newline)) + +(register-generator "hello-world" hello-world) -- 2.39.5