Hi,
"Kjetil S. Matheussen" <[EMAIL PROTECTED]> writes:
> By the way. I'm quite surprised the environments consist
> of linked lists. Wouldn't it be much faster using hash
> tables instead? Perhaps the variables are cached or something?
Yes, variable references are "cached" ("memoized") so that actual
variable lookup occurs only once. So, for instance, in the following
piece of code:
(let ((x 1)(y 2))
(foo y))
the reference to "y" in "(foo y)" is replaced by an "iloc" that says
"this is a reference to the second variable in the first frame". When
that iloc is encountered, the variable's value is fetched by doing
(roughly) two `list-ref's: one to get the frame and then one to get the
variable within the frame.
Clearly, a vector-like data structure (i.e., with O(1) access to
individual elements) would help here.
Thanks,
Ludovic.
_______________________________________________
Guile-user mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/guile-user