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 get arrays


Ole J. Tetlie writes:
 > I apologise in advance if there is a very obvious answer
 > to my question. I'm in the process of using guile to make
 > the computer player in xtron configurable, and this is my
 > first not-tiny use of guile.
 > 
 > My problem is this: I initialise guile from C and everything
 > seems OK. Then I try this:
 > 
 >   gh_eval_str("(display \"Testing\")");
 >   gh_eval_str("(newline)");
 >   gh_eval_str("(define board (make-array 0 200 200))");
 > 
 > When I run this I first get "Testing" printed out, like I
 > wanted. Then it says: "guile: Unbound variable: make-array".
 > 
 > What do I have to do to get make-array and friends bound?

These symbols are usually bound when ice-9 gets booted. This is not done
by gh_enter. Same is true for defmacro, use-modules a.m.o.
One may load ice-9/boot-9.scm by hand, but this is only consistant if it
is clear that the interactive guile read-evaluation loop as provided by
Blandy is not used (gh_repl), otherwise the stack would break down.

    Klaus Schilling