From: Julian Snitow Date: 2003-03-24T11:54:53+09:00 Subject: Re: Ruby lecture slides (was Strong advantages over Python) Jim Weirich wrote: > On Sun, 2003-03-23 at 17:55, Jim Weirich wrote: > >>This problem is was easy to convert because the basic loop is easy to >>unroll. If the algorithm were more deeply nested, or used yield in >>multiple locations, the conversion would be more obscure. For example, >>a generator that returned the leaves of a tree data structure would be >>fairly easy using generators, but more difficult without. > > > Now I'm responding to my own messages, which is dangerously close to > talking to myself. But another, more common, problem where generators > have the advantage is trying to iterate over two lists in parallel. > Never understimate the amazing power of call/cc. (Programming in a language that lacks it is like commuting to work without a personal teleporter... :-)