Unneeded restrictions on local procedures
21 Dec
2023
21 Dec
'23
5:15 a.m.
Exactly! However, if the language allows you to assign that local procedure to a global procedure variable the reader can no longer depend on that being true.
Regards, Chris Burrows CFB Software
Except if one allows assigning a local procedure to a *local* procedure variable, or passing them as a parameter to a *local* procedure. That’s the one restriction that could (perhaps?) be lifted. MODULE M; TYPE Proc = PROCEDURE(i: INTEGER); PROCEDURE P; VAR p: Proc; PROCEDURE Q(i: INTEGER); END Q; PROCEDURE R(p: Proc); END R; BEGIN p := Q; (*should this be allowed?*) R(Q); (*should this be allowed?*) END P; END M.
1071
Age (days ago)
1071
Last active (days ago)
0 comments
1 participants
participants (1)
-
Andreas Pirklbauer