Re: eliminate EXTENSIBLE types?
----boundary-LibPST-iamunique-1319869086_-_-
Content-type: text/plain
On Sat, 02 Oct 2004 12:46:34 +0400, Fyodor Tkachov
<fyodor.tkachov{([at]})nowhere.xy
> I would like to discuss the following simplification of our language:
> would it not be good to banish EXTENSIBLE types altogether?
> Especially that supercalls are to be eliminated.
EXTENSIBLE types or supercalls?
If I understand the proposal right it's concern is not about the type
attribute EXTENSIBLE but about EXTENSIBLE methods and supercalls.
With respect to EXTENSIBLE types (like TYPE E = POINTER TO EXTENSIBLE
RECORD ... END) I think it's a matter of choice. If a programmer wants to
use this kind of class declaration, why not, it's up to him.
Another question is EXTENSIBLE methods which always are delicate matter
because they enable supercalls. But to me this possibility is exactly the
reason for their existence. Imagine the following scenario
TYPE
A* = POINTER TO ABSTRACT RECORD
<attributes>
PROCEDURE (a: A) Init, NEW, EXTENSIBLE;
<other methods>
END;
B* = POINTER TO ABSTRACT RECORD (A)
<more attributes>
PROCEDURE (b: B) Init, EXTENSIBLE;
<more methods>
END;
C = POINTER TO LIMITED RECORD (B)
<more attributes>
PROCEDURE (c: C) Init;
<more methods>
END;
Let each of these types be contained in a separate module. Evidently only
Type C may be instantiated. Nevertheless each of the base types has and
needs it's own Init method
PROCEDURE (a: A) Init, NEW, EXTENSIBLE;
BEGIN
...
END;
PROCEDURE (b: B) Init, EXTENSIBLE;
BEGIN
Init^;
...
END;
and
PROCEDURE (c: C) Init;
BEGIN
Init^;
...
END;
This scenario depends on supercalls, initialization can be and is done in
a clear cut fashion, the Init methods of the base types can't be called
directly.
If you eliminate EXTENSIBLE methods from the language the same situation
looks like this
TYPE
A* = POINTER TO ABSTRACT RECORD
<attributes>
PROCEDURE (a: A) InitA, NEW;
<more methods>
END;
B* = POINTER TO ABSTRACT RECORD (A)
<more attributes>
PROCEDURE (b: B) InitB; NEW;
<more methods>
END;
C = POINTER TO LIMITED RECORD (B)
<more attributes>
PROCEDURE (c: C) InitC; NEW;
<more methods>
END;
So what does InitC has to do? In one possible scenario the abstract
classes define their Init methods like above but InitB does not call InitA
PROCEDURE (a: A) InitC, NEW;
BEGIN
...
END;
PROCEDURE (b: B) InitC, NEW;
BEGIN
...
END;
and InitC has to do all the initializations, probably in a specific order
PROCEDURE (c: C) InitC, NEW;
BEGIN
InitA;
InitB;
...
END;
The other scenario looks like this
PROCEDURE (a: A) InitC, NEW;
BEGIN
...
END;
PROCEDURE (b: B) InitC, NEW;
BEGIN
InitA;
...
END;
PROCEDURE (c: C) InitC, NEW;
BEGIN
InitB;
...
END;
In this case InitC has to call InitB only because InitA is called by InitB
already.
Now imagine the author of InitC does not know about the details, that is
about initializations, and his version of InitC is
PROCEDURE (c: C) InitC, NEW;
BEGIN
InitA;
InitB;
...
END;
The least harmful situation might be that the second call of InitA does
not change anything, it's only superfluous. But can you be shure of this?
There may be situations where the second call destroys some initialization
having been done by InitB and then ... up, up and away!
Of course a behaviour like this ought to be documented, but you can't be
certain everybody will always know the documentation or have it available
and again the ambiguity is there.
So my conclusion is, we need EXTENSIBLE methods and supercalls. Or is
there another way of doing the job I do not see?
Harro von Lavergne
www.lahini.de
--------------------------------------------
To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
blackbox-request{([at]})nowhere.xy
To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.
Send any problem reports or questions related to this email list to the list owner at
owner-blackbox{([at]})nowhere.xy
Current posting policy:
a) To post you should use the same address by which you are subscribed to the mailing list. That way, the list server will recognize you as subscriber and forward your posting immediately, without creating any overhead.
b) If, for some reason, you cannot post from the address, by which you are subscribed, your message will be moderated to avoid spam. Please understand that moderation will often cause some delay, in particular over weekends or holydays.
----boundary-LibPST-iamunique-1319869086_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2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