[r6rs-discuss] set-car!

From: Onnie Winebarger <owinebar>
Date: Fri, 22 Jun 2007 15:20:16 -0400

On 6/22/07, Carl Eastlund <cce at ccs.neu.edu> wrote:
>
> 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.


   I am failing to see how your thesis is true.
   If you are committed to functionalism, your code should (a) only create
immutable objects, (b) never mutate objects handed to it, and (c) require
that other code calling it not mutate objects out from under it. Any time
some other person uses your code without following its advertised
restrictions, they are taking their chances.
   Maybe I'm missing something, but how does your code determine whether the
calling code uses mutable pairs? I know the compiler has this knowledge, I
just don't know where your code can detect and/or specify it as a negative
requirement.

Lynn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.r6rs.org/pipermail/r6rs-discuss/attachments/20070622/2e08a71d/attachment.htm
Received on Fri Jun 22 2007 - 15:20:16 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:01 UTC