diff options
| author | Daniel Colascione | 2015-03-03 10:56:24 -0800 |
|---|---|---|
| committer | Daniel Colascione | 2015-03-03 10:56:24 -0800 |
| commit | cecf4afebb394351a78c48d05e81a1e55af6da32 (patch) | |
| tree | 983591013d5ea7c5375546948044b519dff1680d /doc | |
| parent | 02eb227e8163c6212e814b5b7e191b4d34306872 (diff) | |
| download | emacs-cecf4afebb394351a78c48d05e81a1e55af6da32.tar.gz emacs-cecf4afebb394351a78c48d05e81a1e55af6da32.zip | |
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')
| -rw-r--r-- | doc/lispref/ChangeLog | 4 | ||||
| -rw-r--r-- | doc/lispref/control.texi | 14 |
2 files changed, 12 insertions, 6 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index c27805b3d6e..f96cb26a5e1 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | 2015-03-03 Daniel Colascione <dancol@dancol.org> | 1 | 2015-03-03 Daniel Colascione <dancol@dancol.org> |
| 2 | 2 | ||
| 3 | * control.texi (Generators): Correct missing word. Clarify which | ||
| 4 | forms are legal in which parts of `unwind-protect'. Fix orphaned | ||
| 5 | close parenthesis. | ||
| 6 | |||
| 3 | * objects.texi (Finalizer Type): New section for finalizer objects. | 7 | * objects.texi (Finalizer Type): New section for finalizer objects. |
| 4 | (Type Predicates): Mention finalizers in `type-of' documentation. | 8 | (Type Predicates): Mention finalizers in `type-of' documentation. |
| 5 | * elisp.texi (Top): Link to finalizer type. | 9 | * elisp.texi (Top): Link to finalizer type. |
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 | |||
| 661 | @code{iter-yield-from} yields all the values that @var{iterator} | 661 | @code{iter-yield-from} yields all the values that @var{iterator} |
| 662 | produces and evaluates to the value that @var{iterator}'s generator | 662 | produces and evaluates to the value that @var{iterator}'s generator |
| 663 | function returns normally. While it has control, @var{iterator} | 663 | function returns normally. While it has control, @var{iterator} |
| 664 | receives sent to the iterator using @code{iter-next}. | 664 | receives values sent to the iterator using @code{iter-next}. |
| 665 | @end defmac | 665 | @end defmac |
| 666 | 666 | ||
| 667 | To use a generator function, first call it normally, producing a | 667 | To use a generator function, first call it normally, producing a |
| @@ -693,9 +693,11 @@ evaluating any @code{iter-yield} form. | |||
| 693 | @end defun | 693 | @end defun |
| 694 | 694 | ||
| 695 | @defun iter-close iterator | 695 | @defun iter-close iterator |
| 696 | If @var{iterator} is suspended inside a @code{unwind-protect} and | 696 | If @var{iterator} is suspended inside an @code{unwind-protect}'s |
| 697 | becomes unreachable, Emacs will eventually run unwind handlers after a | 697 | @code{bodyform} and becomes unreachable, Emacs will eventually run |
| 698 | garbage collection pass. To ensure that these handlers are run before | 698 | unwind handlers after a garbage collection pass. (Note that |
| 699 | @code{iter-yield} is illegal inside an @code{unwind-protect}'s | ||
| 700 | @code{unwindforms}.) To ensure that these handlers are run before | ||
| 699 | then, use @code{iter-close}. | 701 | then, use @code{iter-close}. |
| 700 | @end defun | 702 | @end defun |
| 701 | 703 | ||
| @@ -716,8 +718,8 @@ working with iterators. | |||
| 716 | @example | 718 | @example |
| 717 | (iter-defun my-iter (x) | 719 | (iter-defun my-iter (x) |
| 718 | (iter-yield (1+ (iter-yield (1+ x)))) | 720 | (iter-yield (1+ (iter-yield (1+ x)))) |
| 719 | -1 ;; Return normally | 721 | ;; Return normally |
| 720 | ) | 722 | -1) |
| 721 | 723 | ||
| 722 | (let* ((iter (my-iter 5)) | 724 | (let* ((iter (my-iter 5)) |
| 723 | (iter2 (my-iter 0))) | 725 | (iter2 (my-iter 0))) |