[Grace-core] NS inheritance cannot work for grace
Richard Roberts
rykardo.r at gmail.com
Wed Jan 10 13:13:12 PST 2018
>
> If I understand this right, this means that you would evaluate the inherit
> expression in the same way as in a normal request.
Yes, my intention was to see if we could treat inheritance expressions as
normal requests - as you indicated doing so leads to double initialization
and, consequently, perhaps unexpected side effects. Lesson learned :)
On Wed, Jan 10, 2018 at 9:59 AM, Prof. Andrew P. Black <black at cs.pdx.edu>
wrote:
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailhost.cecs.pdx.edu/pipermail/grace-core/attachments/20180111/840fbd80/attachment.html>
More information about the Grace-core
mailing list