Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to include multiple packages with one statement in Ada?

Tags:

package

ada

I wrote a library in Ada and I would like for the client to only need to include one package into their code. Something like:

with all_packages;

That will include all the packages useful for the client. I wrote the library with one package for each tagged type to keep things simple and easy to read.

How do I give the library user the possibility to include all packages with only one statement?

like image 439
user1764972 Avatar asked Mar 24 '26 09:03

user1764972


1 Answers

You can't.

You did well by encapsulating each tagged type in its own package, that's the approach recommended for object-oriented programming in Ada.

Client code then simply 'withs' just those packages it needs.

like image 179
Marc C Avatar answered Mar 28 '26 02:03

Marc C



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!