[r6rs-discuss] set-car!

Eli Barzilay eli at barzilay.org
Mon Jun 25 17:11:35 EDT 2007


On Jun 25, Alan Watson wrote:
> Eli Barzilay wrote:
> >> That something is ironic does not mean that it is bad.
> > 
> > Right, but saying that "irony [is] of the guiding principles of the
> > R6RS" is.
> 
> Irony often refers to saying the opposite of what you mean for
> dramatic effect. It can refer to incongruity between expectations
> and outcomes.

(I said that I'm sure that a dictionary will get used in this thread
sooner or later...)


> When I asked, "is irony a guiding principle", my words were ironic
> in the first sense. I apologize if that offended anyone.
> 
> However, the irony to which I referred was in the second sense, in
> that the proposed solution to one problem eliminated a possible
> solution to another problem. In other words, Eli Barzilay might well
> be happy that the draft R6RS forbids redefinitions, but Carl
> Eastlund might not be happy that, because of this, he cannot
> guarantee that pairs will not be mutated in a program.

Back to the problem, I don't see how allowing redefinitions of all
procedure can provide any form of guarantee, other than anarchy.
These guarantees are all a kind of informal "my code works provided
that nobody redefined any standard procedures before (or after) it
started to run".  Same for redefining `set-car!' and friends:

  ;; this code guarantees no user mutation of lists, provided that you
  ;; load it before you load user code
  (set! set-car! (lambda args (error)))

----

  (define orig-set-car! set-car!)
  ;; load the standard standard stuff up
  (load "standard-init.scm")
  ;; whoever thought about forbidding set-car! should be executed; in
  ;; the meanwhile, I do what I want
  (set! set-car! old-set-car!)
  ...

Coming from an implementation that has been using modules for about a
decade now, I see these hacks as dirty, ugly (non-)solutions.


> This is not to say that the Editors are wrong, but it is a
> legitimate topic for debate.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!



More information about the r6rs-discuss mailing list