[Grace-core] Names, names, names, ...

Andrew P. Black black at cs.pdx.edu
Mon Sep 15 18:14:40 PDT 2014


On 23 Aug 2014, at 10:09, Kim Bruce <kim at cs.pomona.edu> wrote:

> The top of the type hierarchy is Object.  What is the top of the class (inheritance) hierarchy?  It is the class that all objects implicitly inherit from, either directly or indirectly, and contains definitions of ==, asString, etc.  I need a name to talk about it in the text, but there is nothing about its name in the spec (at least that I could find).  Should we call it topClass and invoke it with topClass.new?  I don't particularly care that much, but just need a name.
> 
> Kim
> 

I believe that we talked about this, but can’t find the thread.  IIRC, the name that we agreed on is graceObject.

However, one never needs to utter it, so I’m not sure that we should actually put it in the spec.  (It’s not there as of revision 1864). If you want a new graceObject, you write simply 

	object {}

because any object that doesn’t inherit from a names generator inherits from graceObject.trait or graceObject.new or whatever we want to call it.


> def go = object {}
> print(go)
> def go' = object {}
> print "go = go': {go==go’}"


outputs 

> an object
> go = go': false

I do agree that it’s easier to write the spec and the documentation if we give it a name.   I really want to get rid of these ungraceful .new and .trait operators, though.  Which means coming up with a much more graceful composition operation.

	Andrew




More information about the Grace-core mailing list