         }
         
         func characterSequenceFromString(string: String) -> SequenceOf<Character> {
-            trace("characterSequenceFromString", "create character sequence")
-            return SequenceOf(string.generate())
+            return lazySequence { _yield in
+                func yield(character: Character) {
+                    trace("characterSequenceFromString", "yield(\"\(character)\")")
+                    _yield(character)
+                }
+                
+                for character in string {
+                    yield(character)
+                }
+                trace("characterSequenceFromString", "terminates")
+            }
         }
         
         // Returns sequence of tokens scanned from character sequence

                        yield(result)
                    }
                }
            }
        }
        

        //
        // All other input characters are ignored.
        //
        // The implementation uses three lazy sequences:
        //
        // - A sequence of characters is lazily produced from a string (simulating I/O)
        // - The scanner reads a sequence of characters to lazily produce a sequence of tokens
        // - The parser reads the sequence of tokens to lazily produce a sequence of results
        
        // If showTraceOutput is true, then generate trace output in the debugger window.
        // This is interesting to verify that the I/O, tokenizing and evaluation are
        // interleaved and running on different threads.
        let showTraceOutput = false
        
        // Queue used to serialize trace output from multiple threads
