doublep / iter2

Reimplementation of Elisp generators
GNU General Public License v3.0
9 stars 3 forks source link

How to debug iter2 code not working correctly? #3

Open telotortium opened 2 years ago

telotortium commented 2 years ago

As part of https://github.com/kidd/org-gcal.el/pull/160, I'm working on some code that uses iter2 (via a library https://github.com/skeeto/emacs-aio that I ported to use iter2 instead of iter). I'm having some issues with my code, though. Namely, the loop that I've linked seems to somehow yield early, so that only the first entry in org-gcal-fetch-file-alist is actually processed. What would be the best way to debug the code to see where exactly I'm running into an issue? I know about iter2-generate-tracing-functions, but I'm unsure how exactly to interpret the output of this.

doublep commented 2 years ago

I'm unsure how exactly to interpret the output of this

Sorry, I'm a bit rusty with this, haven't used in a long time. I use it in a private project, but haven't had to debug it since years. So, you need to investigate yourself.

At least some time ago it used to work nicely under Edebug. E.g. set some breakpoints and try g mode. Stepping through also worked fine as far as I remember.

If you discover that iter2 itself behaves incorrectly, please open an issue. A good way to assess is to try using generator library (i.e. iter-defun) and see if the bug persists (then it's in your code) or is gone (then it's likely a fault of iter2).