Thursday, December 24, 2009

In programming, what's the difference between closures and syntactic closures ?

I can't seem to find this explained throughly anywhere on the web. Wikipedia just redirects ';syntactic closure'; to ';closure';, but in that article I can't find anything written on ';syntactic closures';. Are they the same thing ?In programming, what's the difference between closures and syntactic closures ?
Try Google.





Scheme closures are a well-understood concept. Lambda expressions, when evaluated, close over or save the current lexical environment and store it in the procedures they evaluate to. This concept can in fact be easily extended to the syntactic level: expressions can be closed over a syntactic environment. Syntactic environments map names to their denotations. A name's denotation can be a special form (for core syntax, like lambda or if), a macro binding, or a variable binding.





For instance, there is a syntactic environment for standard Scheme.


http://community.schemewiki.org/?syntact鈥?/a>





At http://chicken.wiki.br/syntactic-closure鈥?/a> there is a discussion:


This document describes ';syntactic closures';, a low-level macro facility for the Scheme programming language. The facility is an alternative to the low-level macro facility described in the `Revised^4 Report on Scheme.' This document is an addendum to that report.





The syntactic closures facility extends the BNF rule for TRANSFORMER SPEC to allow a new keyword that introduces a low-level macro transformer:
  • highlight styles
  • blonde highlight
  • oil well
  • toner
  • No comments:

    Post a Comment