summaryrefslogtreecommitdiff
path: root/doc/lispref/control.texi
diff options
context:
space:
mode:
authorDaniel Colascione <dancol@dancol.org>2015-03-03 10:56:24 -0800
committerDaniel Colascione <dancol@dancol.org>2015-03-03 10:56:24 -0800
commitcecf4afebb394351a78c48d05e81a1e55af6da32 (patch)
tree983591013d5ea7c5375546948044b519dff1680d /doc/lispref/control.texi
parent02eb227e8163c6212e814b5b7e191b4d34306872 (diff)
downloademacs-cecf4afebb394351a78c48d05e81a1e55af6da32.tar.gz
Address generator feedback
* doc/lispref/control.texi (Generators): Correct missing word. Clarify which forms are legal in which parts of `unwind-protect'. Fix orphaned close parenthesis. * lisp/emacs-lisp/generator.el: Make globals conform to elisp style throughout. Use more efficient font-lock patterns. (cps-inhibit-atomic-optimization): Rename from `cps-disable-atomic-optimization'. (cps--gensym): New macro; replaces `cl-gensym' throughout. (cps-generate-evaluator): Move the `iter-yield' local macro definition here (iter-defun, iter-lambda): from here. * test/automated/generator-tests.el (cps-test-iter-close-finalizer): Rename `gc-precise-p' to `gc-precise'. * test/automated/generator-tests.el (cps-testcase): Use `cps-inhibit-atomic-optimization' instead of `cps-disable-atomic-optimization'.
Diffstat (limited to 'doc/lispref/control.texi')
-rw-r--r--doc/lispref/control.texi14
1 files changed, 8 insertions, 6 deletions
diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi
index bec2bc92ac4..f512ad990bd 100644
--- a/doc/lispref/control.texi
+++ b/doc/lispref/control.texi
@@ -661,7 +661,7 @@ indicates that the current iterator should pause and return
@code{iter-yield-from} yields all the values that @var{iterator}
produces and evaluates to the value that @var{iterator}'s generator
function returns normally. While it has control, @var{iterator}
-receives sent to the iterator using @code{iter-next}.
+receives values sent to the iterator using @code{iter-next}.
@end defmac
To use a generator function, first call it normally, producing a
@@ -693,9 +693,11 @@ evaluating any @code{iter-yield} form.
@end defun
@defun iter-close iterator
-If @var{iterator} is suspended inside a @code{unwind-protect} and
-becomes unreachable, Emacs will eventually run unwind handlers after a
-garbage collection pass. To ensure that these handlers are run before
+If @var{iterator} is suspended inside an @code{unwind-protect}'s
+@code{bodyform} and becomes unreachable, Emacs will eventually run
+unwind handlers after a garbage collection pass. (Note that
+@code{iter-yield} is illegal inside an @code{unwind-protect}'s
+@code{unwindforms}.) To ensure that these handlers are run before
then, use @code{iter-close}.
@end defun
@@ -716,8 +718,8 @@ working with iterators.
@example
(iter-defun my-iter (x)
(iter-yield (1+ (iter-yield (1+ x))))
- -1 ;; Return normally
- )
+ ;; Return normally
+ -1)
(let* ((iter (my-iter 5))
(iter2 (my-iter 0)))