RFC: order of :postinit calls seems wrong.

 new new list compose Reply to this message Top page
Attachments:
+ (text/plain)
+ (text/html)

Delete this message
Author: Kaz Kylheku
Date:  
To: TXR Users
Subject: RFC: order of :postinit calls seems wrong.

Hi all,

I call your attention to the defstruct macro which can define a :postinit handler.

It is documented (and implemented) that :postinit handlers are called in the opposite order compared to :init handlers.

That seems wrong; we should change it to the same order.

That is when an object is intantiated, do the :init handlers from base to derived, and then do the :postinit handlers in the same order.

The rationale is that :postinit is part of construction, which should proceed in that order. The postinit handlers of the specific derived struct should be able to depend on the effects of the base postinit handlers having taken place, and to be able to override those effects.

Comments?

Needless to say, it will be subject to the compat mechanism (-C option).

Cheers ...