🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.clos
Article #104

using mop to remove instance variables

#104
From: Bryan M Kramer
Date: Wed, 09 Sep 1992 13:46
20 lines
1276 bytes
I have an application where it is redundant to store a value for an
instance variable in a specialization of a class. I'll use numbers as
as an analogy (not that one would do this with numbers in common lisp):

One might have a class called complex-number that has two instance
variables real-part and imaginary part. A second class real-number
would be a specialization of complex-number but doesn't need to store
a 0 in the imaginary part. One could simply write an accessor that
always returns 0.

Has anyone used the MOP to allow a class such as real-number to not
have to store the unwanted instance variables? I'd love to have
someone send me an example so that I can avoid doing the work myself.

Thanks

|Bryan M. Kramer, Ph.D.	      416-978-7330, fax 416-978-1455|
|Department of Computer Science, University of Toronto      |
|6 King's College Road, Room 283E			    |
|Toronto, Ontario, Canada      M5S 1A4                      |
Technical Details
Message-ID: <92Sep9.094603edt.133371@wotan.ai.toronto.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!utcsri!relay.cs.toronto.edu!wotan.ai.toronto.edu!ai.toronto.edu!kramer

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!utcsri!relay.cs.toronto.edu!wotan.ai.toronto.edu!ai.toronto.edu!kramer
Newsgroups: comp.lang.clos
From: kramer@cs.toronto.edu (Bryan M Kramer)
Subject: using mop to remove instance variables
Message-ID: <92Sep9.094603edt.133371@wotan.ai.toronto.edu>
Date: 9 Sep 92 13:46:50 GMT
Lines: 20