From: gautier_niouzes@hotmail.com
Subject: Re: use Ada.Text_IO in main() or Package?
Date: Wed, 13 Sep 2017 23:21:09 -0700 (PDT)
Date: 2017-09-13T23:21:09-07:00 [thread overview]
Message-ID: <13b1d13e-38e5-44b7-9a79-e9b5cbb56b88@googlegroups.com> (raw)
In-Reply-To: <4776d346-325b-4685-8ff4-ddb4ff6e08e3@googlegroups.com>
The "with" clauses are always on top of the text, before anything (package, procedure, function).
A "use" clause opens the visibility ("use Ada.Text_IO" allows you to write "Put" instead of "Ada.Text_IO.Put"), so it can be in the same region as "with", or more locally, inside a function for instance. Sometimes it is more practical to restrict the visibility. In a complex program, you may want to have always a package name prefixed, like "Display.Line" for readability, but in some function that displays plenty of things, it will be more readable to have a local "use Display;", then your bunch of Line(...); Circle(...); etc. are obviously from "Display".
HTH
Gautier
_____________________________________________________________
A free online game in Ada: http://pasta.phyrama.com/game.html
next prev parent reply other threads:[~2017-09-14 6:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-14 5:09 use Ada.Text_IO in main() or Package? Mace Ayres
2017-09-14 5:12 ` Mace Ayres
2017-09-14 6:33 ` Petter Fryklund
2017-09-14 6:51 ` Mace Ayres
2017-09-15 5:22 ` Petter Fryklund
2017-09-14 6:21 ` gautier_niouzes [this message]
2017-09-14 6:47 ` Mace Ayres
2017-09-14 7:13 ` gautier_niouzes
2017-09-14 9:37 ` Mace Ayres
2017-09-14 9:49 ` gautier_niouzes
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox