Quote:
>1) Is r.P^ the only legal notation for the call of the procedure P bound
> to the base type of r (in the following named 'super call ')?
>I would say no, because r (as a receiver) can be of a pointer type, so
>that r^.P^ should also be legal (knowing that r^.x can be abbreviated by
>r.x). This raises the (not too serious) question:
This cannot be correct, as can be seen if you look at the semantics of the
call. If you have definitions as follows,
TYPE P0 = POINTER TO T0 ;
T0 = RECORD ... END ;
PROCEDURE (p:P0) Proc (params) ;
BEGIN ... END Proc;
TYPE P1 = POINTER TO T1 ;
T1 = RECORD (T0) ... END ;
PROCEDURE (p1 : P1) Proc (params) ;
BEGIN ....
p1^.Proc^(params)
END Proc ;
The super-call clearly isn't legal, because it is a call to a procedure
bound to the base type of the dereference of p1, which is of type T0,
not P0;
Quote:
>2) Are 'complex' designators (e.g. r.a.b[e].P^) legal for a super call?
Only if the last element of the designator list (in your case b[e]) is of
the same type as the receiver of the procedure it is called from.
Quote:
>Another point in this issue is the sentence "Within a redefining
>procedure the redefined procedure can be invoked by calling it with the
>suffix ^ ..." found in Differences between Oberon and Oberon-2, which
>seems a bit more restrictive than the relevant statements in the language
>report:
I tend to agree. I feel that a super-call should not be restricted from
within the specific re-defining procedure.
It would be nice to relax the rules to state that the form obj.Proc^ calls
the version of Proc^ bound to the super-type of obj in all cases - provided
such a call is only made within the module in which the extended type is
defined.
It has to be said, however, that I haven't run across a time when I
actually needed this to be the case.
--
-------------------------------------------------------------------------
Ian Marshall,
Real Time Associates Ltd, Tel : (+44)(0)81 656 7333/4/5
Canning House, 59 Canning Road, Fax : (+44)(0)81 655 0401
UK Compuserve : 71333,2456
-------------------------------------------------------------------------