[Grace-core] NS inheritance cannot work for grace

Prof. Andrew P. Black black at cs.pdx.edu
Tue Jan 9 12:59:33 PST 2018


Dear Richard,

I think that the flaw in your translation is here:


> On 29 Nov 2017, at 11:29 , Richard Roberts <rykardo.r at gmail.com> wrote:
> 

> if no inherit expression declared, 
>     1 - make a fresh object
> else 
>     1 - call inherit expression (if found).
>        1.1 invoke the request declared in the inheritance clause
>        1.2 assign the object to self.


If I understand this right, this means that you would evaluate the inherit expression in the same way as in a normal request.  This includes executing the initialization, which might execute methods that will be overridden by traits or by new definitions in the object constructor. 

Then, in step 3 you execute the initialization again, this time with the correct overriding.  This might overwrite any bad initialization done by the earlier initialization, but since the initialization code can have arbitrary effects (like, for example, printing stuff), the double initialization would be visible.

	Andrew




More information about the Grace-core mailing list