[racket] recursion??

From: Rüdiger Asche (rac at ruediger-asche.de)
Date: Tue Jun 5 08:32:18 EDT 2012

Quoting Ronald Reynolds <bumpker at bumpker.com>:

> I hope I'm not too much of a 'pain in the neck noobie' but what is   
> the short clean answer about what's going on when we
> name a function as part of the definition of itself..  This seems   
> pretty esoteric to me.  What does the system do?  

I'm not sure what you mean by "when we name a function as part of the  
definition of itself," but since the title of your question is  
"recursion," I'll just answer as if you had asked "when we write a  
function that recursively calls itself," hoping that that's what you  
meant...

Best place would be to study the documentation for letrec:

"Similar to let, but the locations for all ids are created first and  
filled with #<undefined>, and all ids are bound in all val-exprs as  
well as the bodys. "

I believe this pretty much explains it? It's mostly about scoping and  
name spaces which are really fundamental concepts within Scheme, so  
it's worth looking into those concepts a little bit more in depth.

In the case of #define, the global name space is used which the body  
of the function can always access.




Posted on the users mailing list.