On 12/05/2014 01:32 PM, Stefan Monnier wrote: >> I'd really rather signal to stop iteration. That way, it's harder to ignore >> end-of-iteration and loop forever and it remains possible to iterate over >> *any* value. condition-case is setjmp. I'm not *that* concerned by >> performance. The only other reasonable alternative is for iterators to >> yield a cons (terminal-p . value), and consing is going to be much worse >> than condition-case. > > The alternative I was thinking was to return a unique value, as in: > > (defvar gen-eog (make-symbol "Ħend-of-generator!")) > (defun gen-eog-p (x) (eq x gen-oeg)) > Right. That's the approach I don't like: now there's a value you can't enumerate. What if you wanted to enumerate, say, the values of all symbols?