Kilian Sprotte wrote:
>although I might become an iterate developer one day,

I don't know whether this comment relates to your proposal to find the
"twice previous bug".
Maybe you shouldn't start with the hardest bug.  There are 2 other
issues:

- make Iterate for num accept the exact same keywords as Loop
  e.g. Loop for downfrom to (presumably easiest)
- prefix clause bug
  e.g. cannot define both clauses (foo x) and (foo x bar y).
  (needs correct implementation of a trie)

I took another look at the "twice previous bug" the other day (despite
having -09 time).  My current suspicion is that the code breaks some
invariant.  The previous-code-info keeps a ref and LAST to remember the
for-clause's body.  When PREVIOUS is seen, that body is surrounded with
(setq #:previous-var xyz) and (setq previous-var zyx) with destructive
modifications of list structure.  But doing so, the ref and LAST
pointers must be updated as well, for a second PREVIOUS splice to work.
Maybe that's the invariant that gets violated?

(iter
                   (repeat 3)
                   (for (values a b) = (floor 5 2))
                   (for p-a previous a)
                   (for p-b previous b)
                   (collect (list a b p-a p-b)))

Regards,
        Jorg Hohle.
_______________________________________________
iterate-devel site list
[email protected]
http://common-lisp.net/mailman/listinfo/iterate-devel

Reply via email to