mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 06:20:55 -08:00
* lisp/emacs-lisp/generator.el (iter-yield): Simplify
This commit is contained in:
parent
c952f8b059
commit
0c24ccc9d8
1 changed files with 2 additions and 4 deletions
|
|
@ -143,8 +143,7 @@ the CPS state machinery."
|
|||
(setf ,static-var ,dynamic-var)))))
|
||||
|
||||
(defmacro cps--with-dynamic-binding (dynamic-var static-var &rest body)
|
||||
"Evaluate BODY such that generated atomic evaluations run with
|
||||
DYNAMIC-VAR bound to STATIC-VAR."
|
||||
"Run BODY's atomic evaluations run with DYNAMIC-VAR bound to STATIC-VAR."
|
||||
(declare (indent 2))
|
||||
`(cps--with-value-wrapper
|
||||
(cps--make-dynamic-binding-wrapper ,dynamic-var ,static-var)
|
||||
|
|
@ -645,12 +644,11 @@ modified copy."
|
|||
(iter-close iterator)))))
|
||||
iterator))))
|
||||
|
||||
(defun iter-yield (value)
|
||||
(defun iter-yield (_value)
|
||||
"When used inside a generator, yield control to caller.
|
||||
The caller of `iter-next' receives VALUE, and the next call to
|
||||
`iter-next' resumes execution with the form immediately following this
|
||||
`iter-yield' call."
|
||||
(identity value)
|
||||
(error "`iter-yield' used outside a generator"))
|
||||
|
||||
(defmacro iter-yield-from (value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue