I may have just missed the point to your attempt to derail this conversation =P<br><br>However.. <br><br>Why do all that when you can just <br><br>str = "Hello World"<br>print str * 2<br><br>(Maybe I missed some concept that this small example doesn't accuratly reflect)
<br><br><div><span class="gmail_quote">On 11/6/06, <b class="gmail_sendername">Danny Yoo</b> <<a href="mailto:dyoo@hkn.eecs.berkeley.edu">dyoo@hkn.eecs.berkeley.edu</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>> Wow... I had to click this e-mail just because I saw the first posts on the<br>> mentioned thread and could see it turning for the worst..<br><br>Hi everyone,<br><br>So let's try to squash this one now. There are more interesting problems
<br>to solve. Or other flame wars to fight.<br><br><br>Let me see if we can do something constructive. I've been doing a<br>shallow, superficial study of the Ruby language at the moment. One of the<br>things I've been impressed about is that they've managed to make lambdas
<br>look non-threatening to people with their syntactic sugar of "code<br>blocks".<br><br>For example,<br><br>## Ruby #####################<br>def twice<br> yield<br> yield<br>twice { puts "hello world" }
<br>#############################<br><br>This prints out "hello world" twice in a row: the twice() function takes<br>in an implicit "code block", which it can later call by using their<br>'yield' statement. What the Ruby folks are doing is trying to make the
<br>use of higher-order procedures look really simple. In fact, most of the<br>encouraged idiom style I've seen so far extensively uses this code style<br>pervasively (especially for iteration), and that's very admirable.
<br><br><br>The exact functionality can be done in Python, but it does look a little<br>more intimidating at first:<br><br> ## Python<br> def twice(f):<br> f()<br> f()<br> twice(lambda: sys.stdout.write
("hello world\n"))<br><br>This does the same thing, but it looks a little scarier because the<br>concepts needed to grasp his are superficially harder than that in the<br>Ruby code.<br><br><br>Anyway, let's derail off this regex flamewar and get us back to talking
<br>about code and about stuff that actually matters, like learning how to use<br>functions well.. *wink*<br></blockquote></div><br>