]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/generator.el
Fix breakage from previous change.
[gnu-emacs] / lisp / emacs-lisp / generator.el
index 284de41058049e2273d98b379d5996c5720b5ba3..49af240bb65c469214ff510a58828de0308394a7 100644 (file)
@@ -1,6 +1,6 @@
 ;;; generator.el --- generators  -*- lexical-binding: t -*-
 
-;;; Copyright (C) 2015 Free Software Foundation, Inc.
+;;; Copyright (C) 2015-2016 Free Software Foundation, Inc.
 
 ;; Author: Daniel Colascione <dancol@dancol.org>
 ;; Keywords: extensions, elisp
@@ -25,7 +25,7 @@
 
 ;; This package implements generators for Emacs Lisp through a
 ;; continuation-passing transformation.  It provides essentially the
-;; same generator API and iterator facilties that Python and
+;; same generator API and iterator facilities that Python and
 ;; JavaScript ES6 provide.
 ;;
 ;; `iter-lambda' and `iter-defun' work like `lambda' and `defun',
@@ -57,7 +57,7 @@
 ;; and each iterator maintains its own internal state.
 ;;
 ;; This raw form of iteration is general, but a bit awkward to use, so
-;; this library also provides soem convenience functions:
+;; this library also provides some convenience functions:
 ;;
 ;; `iter-do' is like `cl-do', except that instead of walking a list,
 ;; it walks an iterator.  `cl-loop' is also extended with a new
@@ -90,7 +90,7 @@
   ;; Change this function to use `cl-gensym' if you want the generated
   ;; code to be easier to read and debug.
   ;; (cl-gensym (apply #'format fmt args))
-  `(make-symbol ,fmt))
+  `(progn (ignore ,@args) (make-symbol ,fmt)))
 
 (defvar cps--dynamic-wrappers '(identity)
   "List of transformer functions to apply to atomic forms we
@@ -308,14 +308,14 @@ don't yield.")
                           collect (if (symbolp binding)
                                       (list binding nil)
                                     binding)))
-             (temps (cl-loop for (var value-form) in bindings
+             (temps (cl-loop for (var _value-form) in bindings
                        collect (cps--add-binding var))))
         (cps--transform-1
          `(let* ,(append
-                  (cl-loop for (var value-form) in bindings
+                  (cl-loop for (_var value-form) in bindings
                      for temp in temps
                      collect (list temp value-form))
-                  (cl-loop for (var binding) in bindings
+                  (cl-loop for (var _binding) in bindings
                      for temp in temps
                      collect (list var temp)))
             ,@body)
@@ -507,7 +507,7 @@ don't yield.")
         next-state)))
 
     ;; Process everything else by just evaluating the form normally.
-    (t (cps--make-atomic-state form next-state))))
+    (_ (cps--make-atomic-state form next-state))))
 
 (defun cps--make-catch-wrapper (tag-binding next-state)
   (lambda (form)
@@ -704,7 +704,7 @@ of values.  Callers can retrieve each value using `iter-next'."
 
 (defun iter-next (iterator &optional yield-result)
   "Extract a value from an iterator.
-YIELD-RESULT becomes the return value of `iter-yield` in the
+YIELD-RESULT becomes the return value of `iter-yield' in the
 context of the generator.
 
 This routine raises the `iter-end-of-sequence' condition if the