View difference between Paste ID: 2RtwfwP6 and Wbr1C90Z
SHOW: | | - or go back to the newest paste.
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) );
5+
    return ( scm_from_int( 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
}