[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Dumping guile's state and registering variables.
From: |
Brett Viren |
Subject: |
Re: Dumping guile's state and registering variables. |
Date: |
Wed, 7 Mar 2001 09:26:52 -0500 (EST) |
Martin Grabmueller writes:
> > From: Brett Viren <address@hidden>
> > Date: Tue, 6 Mar 2001 10:42:45 -0500 (EST)
> >
> > I have 2 things I want to do with guile but am unsure how. I am using
> > guile in a C++ ``master world'' program and guile is used to allow
> > functions of the data (stored as guile variables) to be written and
> > applied at run time. So what I want to do is:
> >
> > 1) Keep track of any user defined functions so I can dump them out as
> > scheme code to allow them to be reloaded at a later execution.
>
> Are you translating from another language to Scheme? What is the
> actual problem with dumping out the Scheme code and reloading it? (Or
> is ther a problem at all?)
The user can enter scheme funtions in the middle of running either by
typing into an entry box or by loading a file. What I want is a way
to keep track of any functions which are defined in this manner so
that they can be written out for re-loading next time the program is
run.
Hmm, now that I think of it maybe it is as simple as just manually
saving all strings entered. But, I was wondering if there was a way
of putting all user entered functions into some kind of namespace or
environment and then telling guile to dump the contents of ths space
to a file.
> > 2) The data comes to me in the C++ world as a large integer array and
> > some of it must be preprocessed before being assigned to guile
> > variables. I would like to do this preprocessing in scheme by writing
> > some kind of table or registry with entries of guile variable name,
> > index in array, description of variable, pre processing function and
> > maybe others.
>
> I'm not sure I understand your question here. Do you look for a way
> to store the relation between variable names and its properties
> (index, description, etc.)? Have you thought about using a hash table
> or an association list?
Thank you, I will look into using these.
-Brett.