From: "Hal E. Fulton" Date: 2003-08-20T03:56:10+09:00 Subject: Re: Question: immutable strings as design goal? ----- Original Message ----- From: "Mark Wilson" To: "ruby-talk ML" Sent: Monday, August 18, 2003 7:14 PM Subject: Re: Question: immutable strings as design goal? > While we're still on the subject of Python and Guido Von Rossum's blog > entry, I noted the following: > > "but for me the high point of the evening was Miguel de Icaza's > excitement over Python's feature which makes text files iterators > yielding the lines of the file in succession, so that you can write > > for line in open(filename): > ...process line... " > > At which point I sighed. eyes.roll Actually, someone recently pointed out to me (Gavin I think) that for/in is equivalent to each, but he had wandered away from that since he often needed each_with_index or something similar. So, then. How does Python's example work when you need the index also? Oh, it can be done, all right. Same as in Fortran. For that matter, how do you do each_byte in Python, to iterate a byte at a time? This is not a flame. I don't know Python, and I don't participate in language wars. But the more I learn about Python, the less impressed I am. I certainly see no compelling reason for me to switch from Ruby to Python. On the other hand, it doesn't surprise me that they feel the same way. Hal -- Hal Fulton hal9000@hypermetrics.com