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.
I have ``` #+begin_src emacs-lisp :results output (setq lexical-binding t) (require 'generator) (iter-defun my-iter (x) (let (val (iter-yield (1+ x))) (iter-yield (1+ val))) -1) (let* ((it1 (my-iter 5)) (it2 (my-itr 0))) (print (iter-next it1)) (print (iter-next it1 8)) (print (iter-next it2 nil)) (condition-case x (iter-next it1) (iter-end-of-sequence (print (cdr x))))) #+end_src ``` 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?