On 6/22/07, Onnie Winebarger <owinebar at gmail.com> wrote:
> > In this setup, it's easy to achieve a guarantee of purity (don't
> > import set-c[ad]r!), and easy to achieve impurity (import them). It's
> > a one-line difference. In previous Schemes, impurity is the default
> > but achieving purity requires examining the whole program, and there
> > was no builtin mechanism to guarantee it. I think the R6RS solution
> > comes closer to making both kinds of programming first-class.
>
> The legacy of Scheme's invention is not to make things easy for
> implementors. It is to challenge implementors to make a useful feature or
> programming style usable while embracing functional, imperative, and
> declarative paradigms.
Having a guarantee of purity makes the pure functional style more
usable for programmers. Without an actual guarantee, functions
assuming purity might be sabotaged by some code that mutates a pair.
A developer has to program defensively against mutation, perform a
whole-program analysis to guarantee purity, or take their chances.
With the proposed R6RS, it's a little easier to ensure that an
assumption of purity is safe. I view it as a nice side effect that
implementers might get some optimization out of this purity. They may
see it the other way; the point is that both Scheme users and Scheme
implementers benefit.
--
Carl Eastlund
Received on Fri Jun 22 2007 - 14:36:10 UTC