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=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news-in-01.newsfeed.easynews.com!easynews!core-easynews-01!easynews.com!en-nntp-13.dc1.easynews.com.POSTED!not-for-mail From: agent@drrob1.com Newsgroups: comp.lang.ada Subject: Re: need help learning Ada for a modula-2 programmer Message-ID: <9sq2f91igqmtcltbas3mlqp9vb9r4r2d85@4ax.com> References: User-Agent: ForteAgent/7.20.32.1218 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@easynews.com Organization: Forte Inc. http://www.forteinc.com/apn/ X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly. Date: Tue, 04 Feb 2014 17:38:14 -0500 X-Received-Bytes: 2098 X-Original-Bytes: 2166 Xref: number.nntp.dca.giganews.com comp.lang.ada:184665 Date: 2014-02-04T17:38:14-05:00 List-Id: On Tue, 28 Jan 2014 14:51:52 -0800 (PST), Jerry wrote: >On Monday, January 27, 2014 6:06:43 PM UTC-7, ag...@drrob1.com wrote: > > >The way that I came to terms with Ada strings (coming from Pascal) was to first, learn about the three different kinds of strings; second, pretty much forget what I knew about Pascal strings; third, realize that most of the built-in Ada functions require a fixed-length string as arguments; fourth, work with mostly unbounded strings until it is necessary to pass them to a function, at which time use To_String (and To_Unbounded when going in the other direction); and finally, write all your own subprograms so that they too use fixed-length strings. I rarely or never use Pascal-style strings which are most closely mimiced in Ada by bounded-length strings. > >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.) > >Jerry If I understand this correctly, you advise me to pass standard fixed strings as params, but I can use unbounded strings internally in a routine. Why are you recommending I not use unbounded strings as params?