I prefer to use source blocks for pretty much all my language learning.
I am trying to figure out generators in emacs-lisp but can't seem to run it in a block.
#+begin_src emacs-lisp :results output
(setq lexical-binding t)
(iter-defun my-iter (x)
(let (val (iter-yield (1+ x)))
(iter-yield (1+ val)))
(let* ((it1 (my-iter 5))
(it2 (my-itr 0)))
(print (iter-next it1))
(print (iter-next it1 8))
(print (iter-next it2 nil))
(print (cdr x)))))
But running that gives me
> executing Emacs-Lisp code block...
> cl--assertion-failed: Assertion failed: lexical-binding
I thought that setting lexical-binding to t was enough, but apparently something else is needed?