wow, based on that link, I guess my answer to the "newbie lambda()(??????)" post wasn't that unique. Here's an excerpt that had to do with *why* (not how) the stop function was tied to the function returned from "server":<br>
<br>"Not only CAN you return a function, the REASON you are in this case is
so that its execution will be tied (bound) to the thread that was
started. I am thinking this is an example of a "closure".<br><br>I
guess in OO, you'd make a server "instance", and it would have a "stop"
command . . .. or you could "delete" it (in C++), which would call the
"destructor" . . . or in Java, there's some what of an opportunity in
"finalize()", but not a reliable one. In Python, I'm thinking you'd
have a "stop", and it'd be obvious that construction and "stopping"
aren't symmetric operations.<br>
<br>Now that I've made this comparison, it seems like the argument you
have for fp reduces from "you can't do this in OO" to, "you need more
boilerplate and fanfare to do it in OO" (possibly a whole file,
possibly two -- one for the header and one for the implementation, RAII
semantics on the constructor, etc)."<br><br><div class="gmail_quote">On Sat, Feb 14, 2009 at 10:29 PM, Henk Boom <span dir="ltr"><<a href="mailto:henk@henk.ca" target="_blank">henk@henk.ca</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">2009/2/14 Grant Rettke <<a href="mailto:grettke@acm.org" target="_blank">grettke@acm.org</a>>:<br>
<div>> On Sat, Feb 14, 2009 at 6:24 PM, aditya shukla<br>
> <<a href="mailto:adityashukla1983@gmail.com" target="_blank">adityashukla1983@gmail.com</a>> wrote:<br>
>> Can someone please explain what's the use of having functions as first<br>
>> class data type in scheme .I am a little confused about functions having<br>
>> functions as their arguments .<br>
><br>
> There are problems that you want to solve while programming where you<br>
> will find that first class functions are one good solution. In their<br>
> absence there are other good solutions, too.<br>
<br>
</div>Other good solutions such as objects:<br>
<br>
<a href="http://people.csail.mit.edu/gregs/ll1-discuss-archive-html/msg03277.html" target="_blank">http://people.csail.mit.edu/gregs/ll1-discuss-archive-html/msg03277.html</a><br>
<font color="#888888"><br>
Henk<br>
</font><div><div></div><div>_________________________________________________<br>
For list-related administrative tasks:<br>
<a href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme" target="_blank">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a><br>
</div></div></blockquote></div><br>