[DGD] Recompiling inherited objects

Petter Nystr|m md1pette at mdstud.chalmers.se
Mon Oct 13 22:47:19 CEST 2003


Hello everyone!

I have an issue with recompiling inherited code. The simplified scenario
is this:

Program A inherits program B. Now I wish to recompile B and have A and all
clones of A to use the new code aswell.

It has come to my understanding that this is possible with DGD, but that
you have to do some of the work in your LPC lib. If I have got this right,
the kernel lib aswell as Phantasmal provides public code that does what I
want. However, I have not been able to grasp neither of them. I am playing
around with a lib that still share most of the simplistic structure of the
Melville lib that I begun with.

Even though I am unable to understand how the code of Phantasmal and the
kernel lib does its inner workings, I do feel confident that if I
understood what needs to be done in more general terms, I could code a
functional, albeit perhaps not optimized, system for it in LPC. So my
question is: In general terms, what do I need in order to do accomplish
this?



My initial plan for solving the problem was this: For each object that is
inherited I keep a list of the program-names (masters only) that inherit
that object. I do this through the inherit_program() function in the
driver object. When I compile an existing program that according to my
data-mapping is inherited by other objects, I go ahead and outright
destruct every master object with the names stored in my mapping. When
done and compiled, I can compile all the objects I had to destruct in
order to allow the desired recompilation.

This executes without errors, however, it does not have the desired
effect. Do I understand it right if I think that the problem is that all
the clones of the masters that inherit the code in question have their
link to the original source code severed when their master is destructed?
When I compile the source again, the clones of the old masters are not
updated.

What I wonder then is: Is the solution now to also keep a list of all clones
that inherit a certain  program, and when the new master has been
compiled also recompile everyone of the old clones!? This seems a bit
heavy to me and I am not sure it would work.



Grateful for any tips,

Petter

_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list