2011-06-30

oop storage classes

6.1: adda/type/storage classes:
. recently it was seen how oop's class var's
can be modeled by having vars declared in
the interface type mgt's body
(the implementation module of the interface).

. the same idea can apply to declaring agg' types
(aggregates include the arrays, and records)
which can be just like an interface type
except that an agg's specification can't
declare new operators; [6.20:
ie, the definition of an interface type
is a type that declares
what operations and components
can be applied to obj's of this type;
an agg type is one that need declare only
components .]

. both the {agg', interface} type def's
can declare these 3 storage classes:
# public instance components:
in the typedef's face .
# private instance var's:
in the optional initialization function,
within the typedef's body .
# private class var's:
in the typedef's optional body .

efficiency concerns:
. if the type's face (ada`specification)
doesn't have to declare privates,
then the compiler can never know
what the actual size of an object will be;
whereas, if the face can include
something like: '(privates:0),
then the compiler can potentially know its size .
. however, given the trailer idea
(dynamically extending local mem),
knowing the size is not important anyway:
all act'rec's would have a discriminant bit
indicating the primary record variant:
the one {with, without} a pointer to trailer .
. if with trailer, then any private instance var's
would be on the trailer at that index .

6.1: adda/{begin, end} rename {init,fini}callbacks:
. what I've been calling the {init, fini} routines
should be named {begin, end}
since they mean the same thing in plain english .

No comments:

Post a Comment