简体   繁体   中英

Visibility between Ada Packages

In my main.adb, I with and use separate packages grids.adb and cells.adb. Grids package withs and uses cells, and works ok, visible. Cells withs and uses grids, but code in cells package doesn't see grids.

Where do I make code in grids visible by cells in this mutually dependent arrangement, which I may want to change later.

From your description it looks like your problem is "circular unit dependency" and not a visibility problem. You may solve it if you add " limited with Grid " in your Cell package and do the same with your Grid package.

It would be easier with some code but as stated by Timur, you could use a Limited with .

Moreover, you can read the wikibook on this topic

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM