Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!gatech!csulb.edu!news.sgi.com!su-news-hub1.bbnplanet.com!news.bbnplanet.com!cam-news-hub1.bbnplanet.com!news.mathworks.com!uunet!in2.uu.net!fox.almaden.ibm.com!garlic.com!news.scruz.net!cruzio.com!news
From: "James A. Sawyer" <jas@cruzio.com>
Subject: Re: New Smalltalk root (was Re: X3J20 and isNil (was Re: Conclusion: etc..))
Content-Type: text/plain; charset=us-ascii
Sender: news@cruzio.com (System Administrator)
Content-Transfer-Encoding: 7bit
Organization: Cruzio Community Networking System, Santa Cruz, CA
Message-ID: <3294A0B4.476@cruzio.com>
References: <3285F093.339F@kommsrv.rz.unibw-muenchen.de> <3289BB7C.6839@kommsrv.rz.unibw-muenchen.de> <328FED74.7BA8@best.com> <329107FF.7CB0@concentric.net> <3290F4D6.1879@best.com> <32910457.708B@pobox.com> <3291F557.4415@best.com> <32920EA8.7B71@iconcomp.com> <changi0.9m.2D2C4x$07U@craftedsmalltalk.com>
X-Mailer: Mozilla 2.0 (Win16; U)
Mime-Version: 1.0
Cc: jas@cruzio.com
X-Nntp-Posting-Host: kelp132.cruzio.com
Date: Thu, 21 Nov 1996 18:34:28 GMT
Lines: 78

traymond@pcix.com wrote:
> 
> ...
> I think a better approach would be to have a single rooted
> hierarchy with the root having a minimal set of methods.
> Both, Object and UndefinedObject would be subclasses of
> this minimally defined class.  Proxy classes would also
> be immediate subclasses of this new root.  Furthermore,
> it would be very highly recommended not to add methods
> to the root, as is done with Object.
> 
> ===========================================================
> Terry Raymond       ...

Absolutely.  My own take on reorganizing the root would allow
for another 'missing' distinction between 'uninitialized' values
and 'invalid' values.

In some cases, it is quite legitimate for a method to answer
true to isNil, and trigger some special treatment, e.g. lazy init.

In other cases, it is nice to have an object which aborts on receipt
of any message other than 'isValid', including the message 'isNil'
(thereby signalling a design error).  Such an object could be viewed
as a proxy, but I'd rather see it as a distict class.

Hence the root class would ideally (IMO) subclass as
  RootObject - immutable, and common to all objects.
    InvalidObject     - an immutable singleton 
                          responding false to 'isValid'
                          and 'self invalid:' (ala doesNotUnderstand:)
                          on receipt of all other ValidObject messages.
    ValidObject       - immutable, and common to all valid objects.
      MutableObject   - common to all mutable objects
        ProxyObject   - common to all indirectly instantiated objects,
                          forwarding all undefined, non-inherited messages
                          to proxy target.
          IsObject    - common 'isNess' and 'isNess: aBlock' 
                        interface protocols.

            UndefinedObject - a singleton
                                with reserved value nil,
                                     and no subclasses,
                                responding true  to 'isNil'
                                           true  to 'isValid',
                                           false to all other 
                                           'isNess' messages,
                                evaluating aBlock
                                           in response to 'isNil: aBlock'
                                                      and 'isValid: aBlock'
                                           messages and partial messages,
                                responding with reserved value nil
                                           to all other 
                                           'isNess: aBlock' messages.
                                responding with 'self doesNotUnderstand:'
                                           to all other 
                                           undefined, non-inherited messages.
            Object          - common to all valid, 
                                           directly instantiated 
                                           non-nil objects.

Granted, I do not know quite how to accomplish this, although
'interface protocol' inheritance would surely help.

Any comments as to:

  1) how to construct such a re-rooted hierarchy?
  2) how much existing code might be expected to break?
  3) how valuable such a re-rooted hierarchy would be to you?
  4) how we might forge a common proxy layer such that Smalltalk
     would be Web/Internet/Intranet/DistributedObject enabled
     *by definition* ?
  5) how to go about increasing the speed with which we 
     (as a language base) catch up [if you believe we should]?

Regards,

-jim
