[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Inheritance of instance slots, KR
Date: Fri, 25 Sep 1992 15:00:01 +1200
From: R James Noble <email@example.com>
Resent-Date: Fri, 25 Sep 92 7:58:25 PDT
Resent-From: Urs Hoelzle <urs@otis.Stanford.Edu>
This approach could (in fact) be implemented in Self as it stands,
with judicious use of the Mirror references methods. And (I think)
were some of the information in the compiler's object maps brought out
to the programmer (browse all objects cloned from this object) this
would be even easier. I think this would be more within the style of
Self than adding complicated constraints to the programming
environment - but that's just my opinion. Adding general constraints
to the language - say like Brad Myer's KR object system in Lisp - now
there's an idea!
Hey I'm interested in adding KR-like constraints to Self too!
And I'm working for Brad on Garnet, using KR. KR is a prototype
based object system on top of Common Lips, an AI-style frames system,
with inheritence and constraints. The constraints are one way
formulas that get invalidated when other slots they depend on
change. Not heavy duty crunchy mathematical constraints, but more
like data flow programming. They are very very useful for building
user interfaces. I suppose you could implement them on top of Self,
using constraint accessor methods in slots instead of plain values and
assignment primitives. But KR supports the constraints directly, on
top of lisp, but at the object system level, and I don't know how
efficient it would be to implement them as a layer on top of the
object system in Self. It could be nice to have direct support for
constraints in the language.
Garnet has "aggregadgets" which are very cool -- aggregate prototypes,
that let you do stuff like instantiate (say) a button prototype that's
made out of nested groups of graphical objects, and then change the
prototype (say change the direction of the drop shadow, or the font),
and the changes propagate to all the instances in the user interface!
PS: But Michael Powell says you need a PhD to program in Lisp, so
maybe we should be implementing all this stuff in C++, which he says
is the best object oriented programming language in the world!