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:

> Jim, we'll need your tortoise and hare...

But note that the correct response on circularity is simply to return
a new circular structure, not an error message.

Since the tortoise and hare isn't suitable to detect the location of
the "first" circular reference, we should probably do something
similar to the solution in the printer:

We'll have two versions of copy-tree, one fast which can't handle
circularity and one which can.

`copy-tree' will first run a pair-and-vector tortoise and hare to
determine circularity.  Then it selects the appropriate version of the
copying algorithm.

/mdj