[1235] in Coldmud discussion meeting

root meeting help first previous next next in chain last in chain last

[COLD] public/private/protected object variables

daemon@ATHENA.MIT.EDU (Fri Feb 28 23:17:43 1997 )

Date: Fri, 28 Feb 1997 21:09:59 -0700 (MST)
From: Brandon Gillespie <brandon@cold.org>
To: coldstuff@cold.org

Back when I added public/private/protected methods I considered diong the
same with variables.  Once again I'm considering it--simply because the
need for such a beast is more and more becoming a need for some people. 
What I'm thinking of implementing is three types of object variables.  We
would still keep encapsulation in that only the definer can access
variables and instances it defines.  What we would be expanding on is the
default value for these instances (i.e. what is inherited and how). 

        private     -- act as they do now--if no instance is defined
                       simply return zero.  This would be the default
        protected   -- if there is no instance, use the _definers_
                       instance (and only the definers)
        public      -- get the first instance in the ancestor tree--using
                       the same search requirements as for methods.  We
                       would likely want a cache like with methods..or not.


-Brandon Gillespie