[plt-scheme] Newbie Lambda( ) (???????????)

From: Jesus Boadas (jboadas at gmail.com)
Date: Fri Feb 13 08:46:48 EST 2009

Hello everybody

I am a very very newbie in functional and scheme programming, Im an  
imperative programmer since 1989, following the tutorials in the Plt- 
Scheme  I cant get a clue in this:

   (define (serve port-no)
     (define listener (tcp-listen port-no 5 #t))
     (define (loop)
       (accept-and-handle listener)
       (loop))
     (define t (thread loop))
     (lambda ()
       (kill-thread t)
       (tcp-close listener)))

and

 > (define stop (serve 8081))


I simply cant see the relation between stop and lambda(), lambda() is  
inside the function serve and stop is outside serve, where is the  
logic of this ?


Im very sorry for this dumb question but I will apreciate your help to  
understand this lambda stuff, if anyone can point me into a reference,  
a book, a tutorial, anything.
Also I apologise for errors in this email because english is not my  
mother language.

Best Regards.


Posted on the users mailing list.