home *** CD-ROM | disk | FTP | other *** search
/ Solo Programadores 22 / SOLO_22.iso / docs / lovelace / lesson14.les < prev    next >
Encoding:
Text File  |  1995-11-21  |  11.4 KB  |  287 lines

  1. <COMMENT This is a lesson file for the Lovelace Ada tutorial>
  2. <COMMENT A program called genlesson is used to transform this file into a set>
  3. <COMMENT of useful HTML files for use by Mosaic & other WWW browsers.>
  4.  
  5. <COMMENT  Edit the following lines. >
  6. <TUTOR NAME="Lovelace">
  7. <LESSON NUMBER=14>
  8. <AUTHOR NAME="David A. Wheeler" EMAIL="wheeler@ida.org">
  9. <AUTHOR ADDRESS="<A HREF="dwheeler.htm">David A. Wheeler (wheeler@ida.org)</A>">
  10. <COMMENT $Id: lesson14.les,v 1.4 1995/08/09 21:07:40 wheeler Exp $ >
  11.  
  12. <COMMENT  You'll probably want to uncomment and edit these lines: >
  13. <COMMENT  <PREVIOUS_LESSON LOCATION="URL_of_directory/" >
  14. <COMMENT  <NEXT_LESSON LOCATION="URL_of_directory/" >
  15.  
  16. <COMMENT A lesson is divided into 1 or more "sections".>
  17. <COMMENT Each section has a title; SECTION starts a new section.>
  18.  
  19. <SECTION NAME="Key Ada-Related Documents">
  20. There are a few key Ada-related documents that you should know about:
  21. <UL>
  22. <LI>The most important document is the
  23. Ada <EM>Language Reference Manual (LRM)</EM>,
  24. which has been referred to throughout this tutorial.
  25. The Ada LRM is like a legal contract between a user of the Ada language and
  26. an Ada compiler developer; it defines the rights and responsibilities
  27. of each party.
  28. <LI><EM>Ada Quality and Style: Guidelines for Professional Programmers</EM>
  29. (AQ&S)
  30. provides a set of specific guidelines to help developers produce better
  31. Ada programs.
  32. Basically it's the distilled experience of other Ada users;
  33. most Ada developers use it.
  34. The AQ&S was
  35. developed by the Software Productivity Consortium (SPC).
  36. <LI>The <EM>Ada Rationale</EM> is a document that
  37. explains why Ada is designed the way it is.
  38. <LI>The <EM>Annotated Ada Reference Manual (AARM)</EM>
  39. is an extended version of the LRM.
  40. The AARM is simply the LRM with a large number of additional notes
  41. in each section on the ramifications and implications of every part.
  42. The AARM is used mostly by compiler vendors.
  43. </UL>
  44. <P>
  45. <A HREF="http://lglwww.epfl.ch/Ada/Resources/References.html">All
  46. of these reference documents are available electronically</A>.
  47.  
  48.  
  49. <QUESTION Type=Multiple-Choice>
  50. Which document is a set of guidelines to help you develop better
  51. Ada programs?
  52. <CHOICES>
  53. <CHOICE ANS=1>LRM.
  54. <CHOICE ANS=2>AARM
  55. <CHOICE ANS=3>AQ&S
  56. </CHOICES>
  57. <ANSWER ANS=3>
  58. <RESPONSES>
  59. <WHEN ANS=1>
  60. No, sorry.
  61. The LRM does include some guidelines and hints, but that's
  62. not its main purpose.
  63. <WHEN ANS=2>
  64. No, sorry.
  65. The AARM does include some guidelines and hints, but that's
  66. not its main purpose.
  67. <WHEN ANS=3>
  68. Right.
  69. It'd be a good idea to skim through the AQ&S before you
  70. write a lot of Ada code.
  71. </RESPONSES>
  72.  
  73. <SECTION NAME="LRM Structure">
  74. Since the LRM is the single most important Ada document, it's important
  75. to understand that document's structure.
  76. The LRM contains thirteen sections (numbered 1 through 13),
  77. fourteen annexes (labelled A through P), and an index. 
  78. It also has an introduction which briefly describes the Ada language
  79. as a whole.
  80. <P>
  81. All true Ada compilers are required to implement the ``core Ada language''.
  82. The core of the Ada language is defined in the sections (1 through 13)
  83. and three of the document's annexes:
  84. <UL>
  85. <LI> Annex A, ``Predefined Language Environment'' 
  86. <LI> Annex B, ``Interface to Other Languages'' 
  87. <LI> Annex J, ``Obsolescent Features'' 
  88. </UL>
  89. <P>
  90. Here are the thirteen sections of the LRM, with a simplified description
  91. of what is in each section:
  92. <P>
  93. <OL>
  94. <LI>General - introduces the standard and defines some basic terms.
  95. <LI>Lexical Elements - what are keywords, identifiers, and number syntax.
  96. <LI>Declarations and Types - how to declare
  97. types, constants, variables, and named numbers.
  98. <LI>Names and Expressions - what are legal expressions and uses of types.
  99. <LI>Statements - statement syntax (if, loop, etc.)
  100. <LI>Subprograms - how to declare and define subprograms
  101.   (procedures and functions)
  102. <LI>Packages - how to declare and define packages
  103. <LI>Visibility Rules - scoping rules, use clauses
  104. <LI>Tasks and Synchronization - all about tasks and protected types/objects
  105. <LI>Program Structure and Compilation Issues - how to compile programs, "with"
  106.   clauses
  107. <LI>Exceptions - all about exceptions
  108. <LI>Generic Units - all about generics
  109. <LI>Representation Issues - all about low-level requests
  110.   (requiring records to be stored in certain formats, bit lengths of
  111.   variables, and so on).
  112. </OL>
  113. <P>
  114. Ada compilers may also include features needed by certain application areas,
  115. which are defined in some of the other annexes.
  116. These are called the "specialized needs annexes", and are defined
  117. in annexes C through H.
  118. For example, annex G defines additional requirements and support
  119. packages for numerical work,
  120. and annex H defines additional support for safety and security.
  121. A given Ada compiler may support none or a selected set of these annexes.
  122. <P>
  123. Both the index and the table of contents may help you find a specific
  124. issue you're trying to find out about.
  125. Annex N is the glossary, which may help you understand a specific term
  126. used in the LRM.
  127. <P>
  128. LRM references are usually given in the form of the section number
  129. followed by the paragraph number, with the paragraph number in
  130. parentheses.
  131. Thus, if a compiler error message or someone's post to a newsgroup
  132. references LRM 7.1(3),
  133. they are referring to the third paragraph in section 7.1
  134. (which gives the syntax for a package specification).
  135. <P>
  136. Is the LRM an easy document to read at first?
  137. No, not for most people; it's a lot like reading a legal document.
  138. However, it gets easier to do over time, and it's a useful skill.
  139. Once you are able to look up things in the LRM, you'll be able to
  140. answer authoritatively many Ada-related questions.
  141. <P>
  142. <A HREF="http://lglwww.epfl.ch/Ada/LRM/9X/rm9x/rm9x-toc.html">Magnus
  143. Kempe has developed a hypertext version of the Ada LRM.</A>
  144. It includes three ``zoom levels'' of the table of contents that
  145. you may find very useful.
  146.  
  147. <QUESTION Type=Multiple-Choice>
  148. What section would give more information about protected objects?
  149. <CHOICES>
  150. <CHOICE ANS=1>Section 1.
  151. <CHOICE ANS=2>Section 5.
  152. <CHOICE ANS=3>Section 6.
  153. <CHOICE ANS=4>Section 9.
  154. <CHOICE ANS=5>Section 12.
  155. <CHOICE ANS=6>Section 13.
  156. </CHOICES>
  157. <ANSWER ANS=4>
  158. <SECTION NAME="On-Line Ada Information Sources">
  159. If you're using Ada and have a question, there are a number of
  160. different resources available, depending on the kind of question you have.
  161. As we discussed earlier,
  162. <A HREF="http://lglwww.epfl.ch/Ada/LRM/9X/rm9x/rm9x-toc.html">the
  163. LRM is the authoritative book regarding Ada syntax.</A>
  164. Two other useful on-line sources for answers to common questions include:
  165. <UL>
  166. <LI>
  167. The <A HREF="http://lglwww.epfl.ch/Ada/FAQ/programming.html#title">"Ada
  168. Programmer Frequently-Asked Questions (FAQ)"</A> file.
  169. <LI>
  170. The
  171. <A HREF="http://lglwww.epfl.ch/Ada/FAQ/comp-lang-ada.html#title">comp.lang.ada
  172. newsgroup FAQ.</A>
  173. </UL>
  174. <P>
  175.  
  176. Here are some of the more important Ada WWW servers that are
  177. good sources of Ada-related information:
  178. <OL>
  179. <LI>
  180. The Switzerland Ada WWW Server /
  181. Home of the Brave Ada Programmers (HBAP).
  182. One of the most popular Ada WWW servers is
  183. <A HREF="http://lglwww.epfl.ch/Ada/">Magnus Kempe's <EM>Home
  184. of the Brave Ada Programmers</EM> (HBAP)</A>,
  185. which is located in Lausanne, Switzerland.
  186. This server contains a number of Ada-related items, including this tutorial.
  187.  
  188. <LI>
  189. Public Ada Library (PAL).
  190. The PAL is a library of Ada software, courseware, and documentation.
  191. <A HREF="http://wuarchive.wustl.edu/languages/ada/pal.html">The
  192. main PAL site is in the U.S. at wuarchive.wustl.edu (WUARCHIVE)</A>,
  193. and
  194. <A HREF="http://web.cnam.fr/Languages/Ada/PAL/">a French mirror site</A>
  195. is also available.
  196. <A HREF="http://wuarchive.wustl.edu/languages/ada/userdocs/html/cardcat/00_Tax.html">The
  197. PAL (subject) "card catalog" is an
  198. easy way to directly access the PAL data.</A>
  199. The PAL is currently managed by
  200. <A HREF="mailto:conn@wuarchive.wustl.edu">Richard Conn</A>.
  201.  
  202. <LI>
  203. Ada Information Clearinghouse Home Page.
  204. <A HREF="http://sw-eng.falls-church.va.us/">The
  205. Ada Information Clearinghouse Home Page
  206. provides a collection of Ada-related information.</A>
  207.  
  208. <LI>
  209. SIGAda WWW Home Page.
  210. <A HREF="http://info.acm.org/sigada/">
  211. SIGAda, a Special Interest Group of the Association for Computing Machinery
  212. (ACM), maintains an Ada-related home page.</A>
  213. A number of working groups on specialized areas (such as numerics and
  214. real-time work) have information available through this server.
  215.  
  216. </OL>
  217. <P>
  218.  
  219. This list of servers is only a partial list; in particular there are
  220. a number of Ada software libraries.
  221. <A HREF="http://lglwww.epfl.ch/Ada/">The HBAP server 
  222. has a list of other sources of Ada information</A>.
  223. <P>
  224.  
  225. There are simple ways to answer simple syntax questions.
  226. A nice set of
  227. <A HREF="http://wuarchive.wustl.edu/languages/ada/userdocs/html/cardcat/refcards.html">Ada 95
  228. reference cards have been developed by Paul Pukite</A>.
  229. Members of the Database Research Group at the University of Geneva have
  230. produced a very nice set of documents describing the
  231. <A HREF="http://cuiwww.unige.ch/db-research/Enseignement/analyseinfo/Ada95/BNFindex.html">syntax
  232. rules of
  233. Ada 95 illustrated by syntactic diagrams, with cross-references.</A>
  234. <P>
  235.  
  236. If you're interested in a free Ada 95 compiler, look at
  237. GNAT; the
  238. <A HREF="http://cs.nyu.edu/cs/projects/gnat/">GNAT Project Home Page</A>
  239. has more information.
  240. <A HREF="ftp://ftp.gwu.edu/pub/ada/ez2load">"ez2load"</A>
  241. is a simple-to-install package of Ada-related products (including GNAT)
  242. for IBM-compatible PCs running MS-DOS or Microsoft Windows 3.1/95/NT.
  243. The HBAP server can point you to lists of
  244. <A HREF="http://lglwww.epfl.ch/Ada/Resources/Compilers/Compilers.html">Ada
  245. compilers</A>.
  246. If you're developing a program to analyze an Ada program, you may want
  247. to learn more about ASIS; the
  248. <A HREF="http://www.acm.org/sigada/WG/asiswg/asiswg.html">ASIS
  249. working group</A> page may be of interest to you.
  250. <P>
  251.  
  252. Your next source for answers should be local experts or your compiler vendor.
  253. If you can, ask your local Ada guru at your company or university.
  254. If you have a compiler question, send your question to the compiler vendor.
  255. For example, GNAT bug reports should be addressed to
  256. <A HREF="mailto:gnat-report@cs.nyu.edu">gnat-report@cs.nyu.edu</A>.
  257. For bug reports to any compiler vendor,
  258. be sure to include the expected output, the actual output, the source
  259. code that causes the bug (simplified if possible),
  260. and the version number (GNAT reports this when given the -gnatv option).
  261. <P>
  262.  
  263. If all these approaches fail, post your question to the
  264. <A HREF="news:comp.lang.ada">newsgroup comp.lang.ada</A>.
  265. As when posting to any other newsgroup, don't use inflammatory language,
  266. and include all the information necessary so others can understand your problem.
  267. In particular, state your question clearly,
  268. give the name and version number of your compiler,
  269. give the kind of computer and operating system you're running on,
  270. and include a simple example if that's relevant.
  271.  
  272. <QUESTION Type=Multiple-Choice>
  273. What are the following: HBAP, PAL, GNAT, ez2load, comp.lang.ada?
  274. <CHOICES>
  275. <CHOICE ANS=1>The Switzerland Ada WWW server, a library of Ada components, a free Ada compiler, an easy-to-install set of Ada components for PC's, the Ada newsgroup.
  276. <CHOICE ANS=2>A library of Ada components, the Switzerland Ada WWW server, a free Ada compiler, an easy-to-install set of Ada components for PC's, the Ada newsgroup.
  277. <CHOICE ANS=3>A free Ada compiler, an easy-to-install set of Ada components for PC's, the Ada newsgroup, a library of Ada components, the Switzerland Ada WWW server.
  278. </CHOICES>
  279. <ANSWER ANS=1>
  280. <RESPONSES>
  281. <WHEN ANS=1>
  282. That's correct.
  283. I asked about the abbreviations because you'll sometimes see the
  284. abbreviations in posts to comp.lang.ada.
  285. </RESPONSES>
  286.  
  287.