2012-03-31

packages compared to types

3.23: adda/type/packages compared to types:

. when were child packages needed by ada?
when you want to extend an existing package .
. the point is to reuse the parent package's object
without having to recompile .
. the child's object has links to the parent's object .
. parent package can be compared to supertypes;
they can use the same is.section syntax
to express the {super, parent} relation .

. adda records are not quite like ada packages,
so let us use the terms {record vars, record types};
record types allow you to include vars and subrograms
into an activation record;
each inclusion creates new instances of the vars .
. a record var at top level may be shared by
2 or more concurrently running subprograms .
. safely sharing a var requires the use of
a task's command queuing system .

. it seems possible to merge records and tasks;
ie, they don't need to differ in syntax;
every subprogram can be viewed as an entry;
and the default method for handling entry queues
is to select the queue with the longest line .
. if the compiler sees that vars aren't shared,
(ie, there is no sharing a top-level record instance,
then the optimizer can replace the queue with a direct call ).

No comments:

Post a Comment