summaryrefslogtreecommitdiff
path: root/s7.html
diff options
context:
space:
mode:
Diffstat (limited to 's7.html')
-rw-r--r--s7.html15
1 files changed, 13 insertions, 2 deletions
diff --git a/s7.html b/s7.html
index 0637ea1..130ea0c 100644
--- a/s7.html
+++ b/s7.html
@@ -2201,8 +2201,19 @@ variable named '+iterator+ with a non-#f value:
</pre>
<p>The +iterator+ variable is similar to the '+documentation+ variable used by documentation.
It gives make-iterator some hope of catching inadvertent bogus function arguments that would
-otherwise cause an infinite loop.
+otherwise cause an infinite loop. But unfortunately it can escape and infect
+other functions:
</p>
+<pre class="indented">
+(with-let (let ((<em class="red">+iterator+</em> #t))
+ (lambda () #&lt;eof&gt;)) ; we intended this to be our iterator
+ (concatenate vector (lambda a (copy a)))) ; from stuff.scm
+ ;; (lambda a (copy a)) is also considered an iterator by map (in sequences-&gt;list) because
+ ;; the local +iterator+ is #t. "a" is () because there are no further arguments to
+ ;; concatenate, so (lambda a (copy a)) is generating infinitely many ()'s and this
+ ;; code eventually dies with a heap overflow!
+</pre>
+
<div class="header" id="multidimensionalvectors"><h4>multidimensional vectors</h4></div>
@@ -3947,7 +3958,7 @@ a modern GUI leaves formatting decisions to a text or table widget.
<p>format is a mess. It is trying to cram two different choices into its first ("port") argument.
Perhaps it should be split into format-&gt;string and format-&gt;port. format-&gt;string has no
port argument and returns a string. format-&gt;port writes to its port argument (which must be an output
-port, not a boolean), and returns #f or maybe &lt;unspecified&gt;. Then:
+port, not a boolean), and returns an empty string. Then:
</p>
<pre>
(format #f ...) -&gt; (format-&gt;string ...)