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]

Re: First-class environment proposal


Jim Blandy <jimb@red-bean.com> writes:

>    In Guile, most variables are represented by pairs; the CDR of the
> pair holds the variable's value.  Thus, a variable reference corresponds
> to taking the CDR of one of these pairs, and setting a variable
> corresponds to a `set-cdr!' operation.  A pair used to represent a
> variable's value in this manner is called a "value cell".  Value cells
> represent the "locations" to which environments bind symbols.

It seems inelegant to hardcode the fact that variables are represented
by pairs.  I'd vote for new functions `value-cell-value' and
`value-cell-set!'; for now these could be aliases for `cdr' and
`set-cdr!', respectively.

Carl Witty
cwitty@newtonlabs.com