This is the mail archive of the guile@cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

How to use a scheme function with C...


Ariel Rios writes:
 > I'd been using Guile for a while but only in scheme-only projects. Right
 > I need to create a C program that at run-time may be able to use the
 > guile interpreter and call a specific scheme function.
 > 
 > For example let's suppose I want to create a C programe that receives a
 > value and then call the function factorial declared in Scheme.
 > 
 > "void main(){
 > int a;
 > name_of_function (a){ ;;this function should start the guile interpreter
 > and evaluate
 > (define (factorial n)....  ;;the function factorial.
 > .....
 > ..... } }

You can't start the guile interpreter from some arbitray point inside
the program. Guile must be initialized when main is called and it can't
be exited without exiting the program.

Klaus Schilling

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]