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

Re: good books on scheme?




   Date: Wed, 7 Feb 2001 08:20:31 -0600
   X-Authentication-Warning: max.mcs.gac.edu: max set sender to max@max.mcs.gac.edu using -f
   From: Max Hailperin <max@gac.edu>
   Cc: plt-scheme@fast.cs.utah.edu
   Sender: owner-plt-scheme@fast.cs.utah.edu
   Precedence: bulk

      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 wouldn't call that "closed" or "open". 

   I don't think that Matthias really meant that C procedures were "open"
   like old-fashioned Lisp lambdas, with the "funarg problem."  

Correct. 

   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.  

Now, here I would say Max gives more credit to the designers of C than I
could imagine, not to speak of giving. The notion of closures had been 
well explored by the time C was designed. Algol60 needed it, Landin had
published a series of influential papers, PAL, Scheme had been designed,
etcetc. 

Dave Hanson (UA, 1980ish) wrote a paper that argued languages shouldn't
have lexical scope. And I believe that the arguments there, all informal
and along the lines of "lexical scope considered harmful and confusing" 
are probably what formed the opinion of K&R. DH was closely connected to
that group, and still is. 

   And that, in turn, means that you can't do any of the powerful tricks
   that nested procedures allow.

Correct. 

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

Correct. 

-- Matthias