help / color / mirror / Atom feed
* Limited with too restrictive?
@ 2024-01-13 16:11 Blady
  2024-01-14  4:31 ` Randy Brukardt
  0 siblings, 1 reply; 2+ messages in thread
From: Blady @ 2024-01-13 16:11 UTC (permalink / raw)


I want to break some unit circularity definitions with access types as 
for instance with record:

    type R1;
    type AR1 is access R1;
    type R1 is record
       Data : Natural;
       Next : AR1;
    end record;

In my case, I have a unit:

package test_20240113_modr is
    type R2 is record
       Data : Natural;
    end record;
    type AR2 is access R2;
end test_20240113_modr;

"limited withed" in:

limited with test_20240113_modr;
package test_20240113_mods is
procedure PS1 (V : test_20240113_modr.R2);
procedure PS2 (V : test_20240113_modr.AR2);

Let's imagine the circularity, thus PS1 and PS2 definition are legal.

Of course the following isn't legal:

type AS1 is array (1..2) of test_20240113_modr.R2; -- illegal

However why not with access type:

type AS2 is array (1..2) of test_20240113_modr.AR2; -- illegal

Likewise, why not:

    type AS3 is record
       Data : Natural;
       Next : test_20240113_modr.AR2; -- illegal
    end record;

Isn't "limited with" too restrictive, is it?

Well, I could make some code transferts from unit to another or access 
conversions, that's I actually do but at heavy cost.

Thanks, Pascal.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-01-14  4:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-13 16:11 Limited with too restrictive? Blady
2024-01-14  4:31 ` Randy Brukardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox