[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gh_define() and gh_eval_str()
From: |
Federico Di Gregorio |
Subject: |
gh_define() and gh_eval_str() |
Date: |
19 Jul 2001 20:45:23 +0200 |
hi,
playing a little bit with the gh interface, just to familiarize myself,
i had the following problem. i tought that all the gh_ functions worked
in the same environment (the top level one, to be precise). so i tried:
gh_define("x", gh_int2scm(2));
gh_define("y", gh_int2scm(3));
code = gh_eval_str("(lambda () (display (+ x y)))");
gh_call0(code);
and obtained a nice error:
ERROR: Unbound variable: @
mmm... my idea would be that the lambda is not closing on the same
environment used by gh_define(), but i know to few about guile internals
to even have an idea.
another little question: it is possible to somewhat create an
environment and then have gh_eval_str() compile code closing on that
environment?
this is my first time here (after lurking for some time),
hello to everybody,
federico
--
Federico Di Gregorio
MIXAD LIVE Chief of Research & Technology address@hidden
Debian GNU/Linux Developer & Italian Press Contact address@hidden
Don't dream it. Be it. -- Dr. Frank'n'further
- gh_define() and gh_eval_str(),
Federico Di Gregorio <=