Prototype based programming in Lisp
From: Chris Capel (pdf23ds_at_gmail.com)
Date: 10/27/04
- Next message: Christopher C. Stacy: "Re: Prototype based programming in Lisp"
- Previous message: Jon Boone: "Re: Employment puzzles and Lisp"
- Next in thread: Christopher C. Stacy: "Re: Prototype based programming in Lisp"
- Reply: Christopher C. Stacy: "Re: Prototype based programming in Lisp"
- Reply: josephoswaldgg_at_hotmail.com: "Re: Prototype based programming in Lisp"
- Reply: Kenneth Tilton: "Re: Prototype based programming in Lisp"
- Reply: David Sletten: "Re: Prototype based programming in Lisp"
- Reply: Pascal Costanza: "Re: Prototype based programming in Lisp"
- Reply: Alan Crowe: "Re: Prototype based programming in Lisp"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 27 Oct 2004 13:21:40 -0700
Hi, all.
I've been reading _Godel, Escher, Bach: An Eternal Golden Braid_, by
Douglas Hofstadter, and he mentions at one point that the distinction
between classes and and instances is rather arbitrary and limiting, as
the following list shows (his example):
1) publication
2) newspaper
3) Pleasantville Inquirer
4) May 18's issue of the Inquirer
5) My copy of May 18's issue
In a language with a normal object system (like java, or even, in this
case, Lisp) one would generally only be concerned with two or three
adjacent levels, as problems are rarely concerned with a much wider
domain, and so one would choose the lowest number in the above list as
one's superclass, and subclass that or instantiate it as necessary.
However, this isn't a general solution. If one were to have
"Publication" as a superclass, and "book", "newspaper", and "catalog"
as subclasses, would one have "Pleasantville Inquirer" as a subclass
of "newspaper"? No, it's likely one would choose to make it an
instance of "newspaper". But what if your program requiredments
expanded and you wanted to differentiate based on the date? You can't
instantiate an instance. So perhaps you would be better of going back
and changing "Pleasantville Inquirer" to a subclass of newspaper and
causing individual articles to be instances.
But what's this? We just changed, in our design, an instance into a
class! How odd! Perhaps this speaks of a deeper isomorphism.
Hofstadter, perhaps unintentionally, predicted prototype based object
systems.
So my question is, what does lisp offer in the way of collapsing the
distinction between class and instance? I understand that CLOS by
itself isn't quite sufficient; does the MOP make up for some of this
lack? Are there any other object systems in modern use that take
advantage of this principle?
- Next message: Christopher C. Stacy: "Re: Prototype based programming in Lisp"
- Previous message: Jon Boone: "Re: Employment puzzles and Lisp"
- Next in thread: Christopher C. Stacy: "Re: Prototype based programming in Lisp"
- Reply: Christopher C. Stacy: "Re: Prototype based programming in Lisp"
- Reply: josephoswaldgg_at_hotmail.com: "Re: Prototype based programming in Lisp"
- Reply: Kenneth Tilton: "Re: Prototype based programming in Lisp"
- Reply: David Sletten: "Re: Prototype based programming in Lisp"
- Reply: Pascal Costanza: "Re: Prototype based programming in Lisp"
- Reply: Alan Crowe: "Re: Prototype based programming in Lisp"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]