[r6rs-discuss] set-car!

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

On 6/22/07, William D Clinger <will at ccs.neu.edu> wrote:
>
>
> That is true, but the R6RS could be seen as facilitating
> an improvement.
> [SNIPPED]

OTOH, we can expect at least some implementations will
> behave reasonably, and will provide programmers with
> some measure of control over the mapping from library
> names to code.
>
> In such implementations, programmers will be able to
> substitute the following library for the one provided
> by the implementation:
>
> (library (rnrs mutable-pairs (6))
>
> (export set-car! set-cdr!)
> (import (rnrs base (6)))
>
> (define error-message
> "The (rnrs mutable-pairs (6)) library is off-limits.")
>
> (assertion-violation #f error-message)
>
> (define (set-car! p x)
> (assert #f))
>
> (define (set-cdr! p x)
> (assert #f)))
>
> This isn't foolproof, because someone might perform a
> similar substitution for the (rnrs base (6)) library.


    I do not see the possibility of one library redefining another library
out of meaningful existence as a feature. Library writers should document
the conditions their code requires, they should not be able to rewrite the
entire world to meet their expectations.
    Admittedly, as you said, this could be done under R5RS as well, but it
wasn't something to encourage.

Lynn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.r6rs.org/pipermail/r6rs-discuss/attachments/20070622/80feb4a9/attachment.htm
Received on Fri Jun 22 2007 - 16:42:58 UTC

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