Advertisement
Guest User

Untitled

a guest
Apr 25th, 2014
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <iostream>
  2. #include <libguile.h>
  3.  
  4. SCM test_func(SCM width, SCM height) {
  5.     return ( scm_to_int(width) * scm_to_int(height) );
  6. }  
  7.  
  8. int main(int argc, char *argv[]) {
  9.  
  10.     SCM func;
  11.     scm_init_guile();
  12.    
  13.     scm_c_define_gsubr("test_func", 1, 0, 0, test_func);
  14.     scm_c_primitive_load("script.scm");
  15.    
  16.     func = scm_variable_ref(scm_c_lookup("simple-func"));
  17.    
  18.     scm_call_0(func);
  19.    
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement