Reflection and quotation

Kyle Lahnakoski kyle@arcavia.com
Tue, 22 Aug 2000 12:11:35 -0400



"RE01 Rice Brian T. EM2" wrote:

> > From: Kyle Lahnakoski
> 
> > Textual representation of objects of any type eh?  My simple answer is
> > impossible.  :)  I consider human readable text (text that is not
> > difficult to read from left to right, top to bottom) to be
> > parsable by a CFG.  Structures that are richer then hierarchical
> > graphs can not be represented textually.
> > Rich structures can only be human readable in 2 dimensions, and this
> > means visually.
> 
> So, how does this help us understand quotation better? How does this help us
> learn from and transcend the limited forms we have currently? Obviously,
> quoting opens up a necessarily(?) available part of the lexer/parser.
> Another view is that it provides a built-in (set of or kernel of)
> function(s) for casting the types of objects into basic code types.

Textual quotation has limits.  I thought that was what you were looking
for: to extend textual quotation to something more general, but still
textual.  It is apparent now that you do expect the generalization to be
a visual solution.  Visual quotation should be called referencing, and
like I mentioned in my previous posts, any combination of (typed)
attributes that uniquely identify an object can be considered a
reference.  Attributes I mention can themselves be references, not
necessarily primitive.



> > The key words above are "human readable".  All objects can be
> > serialized, but the inexperienced human mind can not take a
> > serialization and "see" the important relationships between
> > the elements of a structure.  XML embodies the ability to represent
> > objects textually.  All the problems with textual representation show
> > up as problems with XML.
> 
> Why human-readable? What's wrong with using a visual diagram to not just
> represent, but denote (as the primary means of denotation) something
> linguistically? Of course a whole system will need both textual as well as
> visual ways to convey information and denote objects, but I hardly consider
> textual braces to convey the notion of a set in its most natural sense or
> generality of definition.
> 
> In the Self system, you have a user interface which has both visual (the
> object-slot relationship is depicted as well as inheritance) and textual
> aspects to it. The same is true of many other applications, like CAD/CAM
> systems (which I worked with and on for a while).

We both agree here, I had mentioned the same: "Structures that are
richer then hierarchical graphs can not be represented textually.  Rich
structures can only be human readable in 2 dimensions, and this means
visually." 



> > Once your application is not bound by textual representation, the
> > indication of object type is simpler.  Self was doing the right thing
> > when representing objects the way it does.  Issues, like quoting, are
> > trivial.
> 
> How closely did you look at Self? Its MOP is supplemented by
> implementational support of quotation by the system of Mirror objects (see
> the Self Programmer's Reference Manual) that its VM provides to reify the
> structure of literal types. This *is* a kind of quotation, even though it
> doesn't get commonly called this. We need to detail a framework for
> dynamically modifying and extending this idea.

My fault for not being clear.  I only meant to refer to Self's visual
object representation (Morphic).



> Furthermore, if you compare Self with (what I'm trying to do with) Slate,
> you'll see that its syntax contains lots of dependencies on static quotation
> primitives (like strings and arrays and blocks and such). Of course this is
> unfair to Self, since just about every language has this same set of
> crutches.

Maybe I will tell you about my "quotation" system.  Maybe you can help
me understand what you are looking for by providing a problem that my
system can not solve.

There is a concept called a Space.  Each Space has zero or more
dimensions.  Each dimension has its own range, not necessarily
distinct.  Any object that is in this space will have a value
(coordinate) in each one of the dimensions.  The set of
dimension/coordinate values is unique for each object in the space.  

Example of 2D Matrix Space:  We assume the matrix is 3 columns by 4
rows.  We can specify any element on the matrix by indicating the
ordered pair (r, c).  

Every object is a member of the one dimensional Primary_Key space where
each object is given a unique value.  Since objects are allowed to
multiply instanciate.  They can be members of Primary_Key space and
other user defined spaces.  It should be obvious why this space deserves
mention.

Example continued:  Each element is an object, therefore it is also a
member of the Primary_Key space.  That means each element can also be
referred to by a key value.

Referencing objects is done through spaces.  Some examples I have now
are the Table_Space consisting of Database and Class dimensions (for
each Class(type) there is only one table holding that type per
database).  There is the instanciation space with Class, Object
dimensions.  The environment will commonly map the multidimensional user
dimension to the Priamary_Key dimension for internal representation.

The Variable_Space deserves special mention because it embodies
referencing.  Classes have field definitions.  Every object that is an
instance of a particular class must have a single variable(slot) for
each of the defined fields.  We see that for any single object/field
pair there is at most a single variable in existence.  This explains the
Object and Field dimensions of a variable.  Since variables are objects
they also have a Primary_Key dimension.  I like to write variables as
triples: (Key, Object, Field).  Variables embody the concept of a
reference, therefore every variable points to some other object.  This
can be extracted by using the getValue() function.  I do not allow
variables to be 4-tuples (Key, Object, Field, Value) because they ARE
the value.

Again.  What specific problems are you looking at that can not be
solved?

----------------------------------------------------------------------
Kyle Lahnakoski                                  Arcavia Software Ltd.
(416) 892-7784                                 http://www.arcavia.com