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] |
I would like to have the following primitive added to
variables:
(variable-bind-pair <pair>) -----> #<variable>
The new variable would directly reference the pair
for use within eval and such.
e.g.
> (define x '(x . 3))
> (define xvar (variable-bind-pair (cons 'x 3))
#<variable name: x binding: 3>
> (variable-set! xvar 10)
> x
(x . 10)
I am divorcing the object system from the module system and
implementing directly on the primitives and I find
that I do not really need to store bindings as variables but
I can get away with pairs and create variables only
when needed by eval. This is to save memory and reduce
the normal access time for objects.
Wade.
---------------------------- diff variable.c variable.c.old
169,181d168
< SCM_PROC(s_variable_bind_pair, "variable-bind-pair", 1, 0, 0, scm_variable_bind_pair);
<
< SCM
< scm_variable_bind_pair (pair)
< SCM pair;
< {
< SCM_ASSERT (SCM_NIMP(pair) && SCM_CONSP(pair), pair, SCM_ARG1, s_variable_bind_pair);
<
< if (SCM_CAR(pair) == SCM_UNDEFINED)
< SCM_SETCAR(pair, anonymous_variable_sym);
<
< return make_vcell_variable (pair);
< }
---------------------------- diff variable.h variable.h.old
64d63
< extern SCM scm_variable_bind_pair SCM_P ((SCM pair));