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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: border1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!goblin2!goblin.stu.neva.ru!cyclone03.ams2.highwinds-media.com!news.highwinds-media.com!voer-me.highwinds-media.com!post02.fr7!fx11.fr7.POSTED!not-for-mail Message-ID: From: Mike H Reply-To: Mike Hopkins Newsgroups: comp.lang.ada Subject: Re: need help learning Ada for a modula-2 programmer References: MIME-Version: 1.0 Content-Type: text/plain;charset=us-ascii;format=flowed User-Agent: Turnpike/6.07-M (<8c+$+zb077Pti5diXa8NqJs7Yt>) NNTP-Posting-Host: 83.104.138.185 X-Complaints-To: abuse@demon.net X-Trace: 1390997781 83.104.138.185 (Wed, 29 Jan 2014 12:16:21 UTC) NNTP-Posting-Date: Wed, 29 Jan 2014 12:16:21 UTC Date: Wed, 29 Jan 2014 12:15:58 +0000 X-Received-Body-CRC: 2978316355 X-Received-Bytes: 1935 X-Original-Bytes: 2139 Xref: number.nntp.dca.giganews.com comp.lang.ada:184588 Date: 2014-01-29T12:15:58+00:00 List-Id: In message , Jerry writes >When I started Ada, learning about strings and subtypes were the two >most important concepts that got me writing basic code effectively. (I >could add, Ada's most excellent approach to variable-length arrays.) > I agree, approaching string types as being no different from other forms of array types (and vice-versa) is the right way to go in Ada. As an exercise, the OP might like to try writing a body for generic type Item is private; type Index is (<>); type Array_type is array (index range <>) of Item; function Shift_right_circular (A : Array_type; Places : Natural) return Array_type; Hint: some of the attributes 'FIRST, 'LAST, 'LENGTH, 'PRED, 'POS, 'SUCC, 'VAL and etc. may be of some use. If the body is about a dozen lines of code then you may feel satisfied that you have really cracked it. -- The thing I like best about the Internet is that no one knows that, in reality, I am just another old dog! Mike