bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#28725: 26.0.60; Error when using Edebug on a generator


From: Gemini Lasswell
Subject: bug#28725: 26.0.60; Error when using Edebug on a generator
Date: Mon, 21 Oct 2019 09:29:04 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3.50 (gnu/linux)

Lars Ingebrigtsen <larsi@gnus.org> writes:

> I'm able to reproduce this bug in Emacs 27.
>
> Does anybody know what's causing this?  It's bugging out in the
> `iter-yield' call.

I took a look and I think the problem is that cps--transform-1 doesn't
look inside lambda forms.  When Edebug instruments a function, it wraps
the body of the function in a lambda form.

Here's a code sample to reproduce the bug with just eval-buffer, no
Edebug necessary:

;;;  -*- lexical-binding: t -*-

(require 'generator)

(iter-defun mycounter (start)
  (let ((i 0)
        (offset-yield-func (lambda (x) (iter-yield (+ x start)))))
    (while t
      (funcall offset-yield-func i)
      (setq i (1+ i)))))

(defun my-iter-do ()
  (let (results
        (tally (mycounter 10)))
    (dotimes (_ 4)
      (push (iter-next tally) results))
    results))

(my-iter-do)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]