diff options
Diffstat (limited to 's7.html')
-rw-r--r-- | s7.html | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -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 () #<eof>)) ; 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->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->string and format->port. format->string has no port argument and returns a string. format->port writes to its port argument (which must be an output -port, not a boolean), and returns #f or maybe <unspecified>. Then: +port, not a boolean), and returns an empty string. Then: </p> <pre> (format #f ...) -> (format->string ...) |