On 11/11/2012 15:52, John Cowan wrote:
> On Sunday, November 11, 2012 9:26:02 AM UTC-5, Pascal Costanza wrote:
>
>> Dynamic binding is not so problematic as you seem to want to make it
>> appear. It's easy to add dynamic binding to Scheme as a library, and
>> will apparently be part of R7RS as well. This doesn't affect the rest of
>> the language in negative ways, neither in Scheme, nor in Common Lisp.
>
> It's not whether bindings are dynamic or static (though it happens
> that in Common Lisp all global bindings are dynamic).
That's also incorrect: Macro bindings, symbol macro bindings and
function bindings are not dynamic. Especially symbol macros allow you to
implement global lexical variables.
> It's that CL EVAL
> sees certain bindings of the running program and therefore can affect it
> in unknown ways.
Sure.
> In Scheme this is not true, unless both the program and
> `eval` are using the interaction environment. Otherwise, there is a
> complete firewall between a Scheme program and anything `eval` can do:
> in principle, `eval` could compile and run a program in a completely
> separate address space, as long as it had a copy of the existing dynamic
> environment.
OK.
> R7RS support for dynamic binding involves first-class objects; all
> variables remain lexically bound. Note that R7RS parameters, unlike SRFI
> ones, aren't mutable, so it is transparent whether they are shared or
> copied by threads or subprocesses.
This means you don't have the equivalent of SET, but it still means you
have the equivalent of PROGV.