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: eval'ing a self-referential vector


Mikael Djurfeldt <mdj@nada.kth.se> writes:

> It isn't necessary to use the tortoise and hare since eval does right
> in not expecting circular code.  What is wrong is that scm_copy_tree
> copies vectors as well as pair structures.
> [...]
> I just committed a change where I've removed the ability of copy-tree
> to copy vectors, so the bug should be fixed now.

Sigh... that went a bit too quickly.

Here's a counterexample:

(define x 0)
(define exp '(+ x 0))
(define exp2 ``#(,,exp))
(eval exp2)

If scm_copy_tree doesn't copy vectors, exp will be memoized...

I'll revert my change now.
Jim, we'll need your tortoise and hare...

/mdj