[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: good books on scheme?



   From: "Immanuel Litzroth" <immanuel_litzroth@hotmail.com>
   Date: Wed, 07 Feb 2001 13:57:39 -0000

   >Let me point out though that using the terminoloy 'closure' makes sense
   >when you discuss first-class procedures with an uneducated C hacker who
   >thinks that pointers to functions are first-class procedures. Decades
   >after "LISPers" understood this point, C hackers still don't see the
   >difference.
   Not being a C hacker, but definitely uneducated I wonder if the greatest 
   difference between C function pointers and first-class procedures is not the 
   fact that they cannot be created at runtime because you have neither the 
   compiler nor the symboltable present?
   Aren't C functions closures in the sense mr Hailperin described?
   Immanuel

Actually, C procedures *are* closed (there is no capture of free
variables), but this doesn't require the usual "closure" machinery,
because C procedures aren't allowed to be nested.  So the only
variables are locally bound within the procedure or totally global --
so there is no need for a binding environment.

I don't think that Matthias really meant that C procedures were "open"
like old-fashioned Lisp lambdas, with the "funarg problem."  Instead,
I think he meant that since the implementation technique of "closure"
isn't what was used to keep the procedures "closed," the language
designers were forced to resort to another, more primitive, technique,
namely forbidding any nesting of procedures.  And that, in turn, means
that you can't do any of the powerful tricks that nested procedures
allow.

This has nothing to do with having the compiler or symbol table
around at run time.  -max