This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: setf.scm


> It is true that you get global changes by adding a new method to a
> generic function, but I do not see this as any different if methods
> was stored inside classes. If you add a new method to a class object,
> thus changing its method table, then the associated generic function
> would (globally) change its behaviour.

But with single dispatch you don't "add a new method to a class object".
You add a new class *with its associated method table*.  The new class
does not change any old method tables.

(Note:  Your program environment may allow you to replace methods
in-place, but that is a programming environment feature, not a
language feature.  Similarly, your environment may allow you
to change the classes of existing objects, but the language
should not.  I am talking about the run-time environment,
not the develpment environment.)

	--Per Bothner
Cygnus Solutions     bothner@cygnus.com     http://www.cygnus.com/~bothner