Another clarification about local names

Topics related to the use of Oberon language features
Post Reply
kevinhely
Posts: 28
Joined: Wed May 18, 2011 3:35 am

Another clarification about local names

Post by kevinhely » Thu Sep 05, 2019 9:41 pm

Hi again,

The language definition states:
The use of the procedure identifier in a call within its declaration implies recursive activation of the
procedure.
That would seem to rule this out as legitimate code:

Code: Select all

PROCEDURE P;
    PROCEDURE P; END P; (*local*)
BEGIN P (*which P does this refer to?*)
END P;
(In earler times, the local declaration would have 'hidden' the name of the outer procedure.)
Do you agree? (I won't keep posting questions like this!)

Regards

cfbsoftware
Site Admin
Posts: 403
Joined: Fri Dec 31, 2010 12:30 pm
Contact:

Re: Another clarification about local names

Post by cfbsoftware » Fri Sep 06, 2019 12:12 pm

The outer P (a global object) would still be hidden by the inner P (a local object) wouldn't it?

kevinhely
Posts: 28
Joined: Wed May 18, 2011 3:35 am

Re: Another clarification about local names

Post by kevinhely » Fri Sep 06, 2019 4:26 pm

I would have thought so but it contradicts the quoted statement.

Post Reply