----boundary-LibPST-iamunique-2114707877_-_-
Content-type: text/plain
Hello:
here is a short module which does not compile, what looks strange.
The PT is an extension of Stores.Store. It is a record, not a pointer
to record. The language report says that it should be allowed, and
the compiler does not complain about the PT declaration.
The PPT is also an extension of Stores.Store, but this time it is a
pointer. This is also allowed.
The following citation from the Language Manual suggests that all is fine.
The base type can be a RECORD or alternatively a pointer. I infer that
both the PT and PPT declarations are just fine, and the compiler thinks
the same.
> Alternatively, a pointer type can be specified as the base type. The
> record base type of the pointer is used as the base type of the declared
> record in this case.
So, why does not the following module compile? Excuse me if the answer is
obvious. I somehow cannot figure this out.
MODULE DanomTest;
IMPORT Stores, Dialog;
TYPE
PT* = RECORD (Stores.Store)
tree*: Dialog.Tree
END;
PPT* = POINTER TO RECORD (Stores.Store)
tree*: Dialog.Tree
END;
(*compile error "parameter does not match"*)
PROCEDURE (VAR pt: PT) Internalize-(VAR rd: Stores.Reader);
BEGIN (*Internalize*)
END Internalize;
(*compile error "parameter does not match"*)
PROCEDURE (VAR pt: PT) Externalize-(VAR wr: Stores.Writer);
BEGIN (*Externalize*)
END Externalize;
(*no error*)
PROCEDURE (ppt: PPT) Internalize-(VAR rd: Stores.Reader);
BEGIN (*Internalize*)
END Internalize;
(*no error*)
PROCEDURE (ppt: PPT) Externalize-(VAR wr: Stores.Writer);
BEGIN (*Externalize*)
END Externalize;
END DanomTest.
Wojtek Skulski skulski{([at]})nowhere.xy
--------------------------------------------
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-iam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