From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_00,PDS_OTHER_BAD_TLD autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5b062cdca243a886,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-31 17:56:23 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!wn1feed!worldnet.att.net!135.173.83.71!wnfilter1!worldnet-localpost!bgtnsc06-news.ops.worldnet.att.net.POSTED!not-for-mail Message-ID: <3B67526E.D7E19382@worldnet.att.net> From: James Rogers X-Mailer: Mozilla 4.76 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Please review and comment Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Wed, 01 Aug 2001 00:48:34 GMT NNTP-Posting-Host: 12.86.33.161 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc06-news.ops.worldnet.att.net 996626914 12.86.33.161 (Wed, 01 Aug 2001 00:48:34 GMT) NNTP-Posting-Date: Wed, 01 Aug 2001 00:48:34 GMT Organization: AT&T Worldnet Xref: archiver1.google.com comp.lang.ada:10903 Date: 2001-08-01T00:48:34+00:00 List-Id: A recent posting in comp.lang.ada from a newbie requested a document listing common Ada programming idioms. This request seemed quite reasonable to me. As a result I have started to create such a document. Currently I have only a short introduction and a table of contents. I would like comments on the current table of contents. Please suggest additional subject matter, as well as possible reorganizations. Thank you Jim Rogers Colorado Springs, Colorado USA Ada Idioms and Source Code Examples James Rogers Last Updated July 31, 2001 This document presents several of the most common Ada coding idioms including simple source code examples. This document is not intended to be a full tutorial on the Ada language. Instead, it is intended to be a tool for rapid reference to common Ada coding idioms. When learning any new language it is important to learn how to design your code to most fully cooperate with the features of the language. It is common for a person to try to design code for a new language using patterns and idioms from the person's most familiar language. One old quote is "A good programmer can write Fortran in any language". The sad truth is that you will not get the greatest benefit from a language if you do not learn to "think" in terms of that language. Table of Contents 1.Defining Data Types 1.Defining Integer Types 2.Defining Modular Types 3.Defining Enumeration Types 4.Defining Floating Point Types 5.Defining Fixed Point Types 6.Defining Array Types 7.Defining Record Types 8.Defining Discriminant Records 9.Defining Record Layouts 10.Defining Tagged Types 2.Looping 1.Simple Loop 2.While Loop 3.For Loop 3.Branching 1.if then else 2.case statement 4.I/O 1.Text IO 2.Sequential IO 3.Direct IO 4.Stream IO 5.Exceptions 1.Defining Exceptions 2.Handling Exceptions 3.Using the package Ada.Exceptions 6.Packages 1.Package Specification 2.Package Body 3.Separates 4.Hierarchical Packages 7.Subprograms 1.Functions 2.Procedures 8.Concurrent Programming 1.Tasks 1.Task Definitions 2.Task Bodies 3.Task Rendezvous 4.The Accept Statement 5.Selective Accepts 2.Protected Objects 1.Protected Object Specifications 2.Protected Bodies 3.Protected Functions 4.Protected Procedures 5.Protected Entries 6.Requeuing 3.Pragma Atomic 4.Pragma Volatile 9.Generics 1.Generic Formal Parameters 2.Instantiation of Generic Units 10.Memory Management 1.Dynamic Memory Allocation 2.Dynamic Memory Deallocation 3.Storage Pools 11.Abstract Types 1.Defining Abstract Types 2.Using Abstract Types 3.Ada.Controlled 4.Ada.Limited_Controlled