🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.clos
Article #638

Adding new mixins to a predefined class

#638
From: Alan Ruttenberg
Date: Mon, 17 Jun 1991 18:16
20 lines
1241 bytes
Is is possible to incrementally modify the definition of a class?

What I have in mind is something like

(defclass extra-mixin () ((extra-instance-variable)))

(add-class-mixin predefined-class extra-mixin)

- actually it would make more sense to do something like a setf of
class-precedence-list, since you don't know where to add the mixin above.

The example comes up in the following way. There is a class of windows
which is supplied by the implementation. I want to add some
functionality which requires an extra instance variable. I can't
modify the source code, because I don't have it. So it would be nice
to modify the class by adding a new instance variable, or some new
default-initargs, or whatever.

-alan
Technical Details
Message-ID: <ALANR.91Jun17131614@chopin.media-lab.media.mit.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!news.media.mit.edu!news.media.mit.edu!alanr

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!news.media.mit.edu!news.media.mit.edu!alanr
From: alanr@chopin.media-lab.media.mit.edu (Alan Ruttenberg)
Newsgroups: comp.lang.clos
Subject: Adding new mixins to a predefined class
Message-ID: <ALANR.91Jun17131614@chopin.media-lab.media.mit.edu>
Date: 17 Jun 91 18:16:14 GMT
Sender: news@news.media.mit.edu (USENET News System)
Organization: MIT Media Laboratory
Lines: 20