[Grace-core] Inheritance and object initialisation

Andrew Black black at cs.pdx.edu
Tue Jul 17 17:44:27 PDT 2012


On Jul 17, 2012, at 4:03 PM, Kim Bruce wrote:

> Because no one complained, I wrote up my proposed semantics of classes and objects generated from them.  I'm leaving now to meet my daughter in LA for dinner, so had to stop before talking about inheritance.  However, I suspect even this page and a half will take some time to digest (and I didn't even write down how method invocations work, though that is pretty easy).
> 
> Let me know if you have questions or comments.
> 
> Kim

I was busy commenting (it took several hours) while you were writing.  Now you have my comments.  

Your semantics looks fine as far as it goes, but I note that you explicitly do not take into account the situation where the initial value of an instance variable refers to self, or where there is top-level code in the object constructor.  These are exactly the cases that Michael's examples are forcing us to confront!

I'm also dubious about taking the fixpoint that defines for the methods when the constructor is evaluated.  That's fine until we have inheritance, but then it breaks.  I think that we may need to delay the taking of fixpoints in the methods until the methods are executed (which is what all real implementations do}.  The tricky thing, then, is when to bind self in block-closures that are bound to defined names.

	Andrew

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailhost.cecs.pdx.edu/mailman/private/grace-core/attachments/20120717/8354a122/attachment.html>


More information about the Grace-core mailing list